循环和递归
递归:易于理解、速度慢、存储空间大
循环:不易理解、速度快、存储空间小
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>long sum_sum(int n) {if (1 == n) {return 1;}else {int sum = n + sum_sum(n - 1);return sum;}}
int main(void) {sum_sum(5);printf("%d\n", sum_sum(100));while (true) {}return 0;
}