https://pintia.cn/problem-sets/12/problems/350
1 int sum(int n) 2 { 3 if (n <= 0) 4 { 5 return 0; 6 } 7 else 8 { 9 return n + sum(n - 1); 10 } 11 }
https://pintia.cn/problem-sets/12/problems/350
1 int sum(int n) 2 { 3 if (n <= 0) 4 { 5 return 0; 6 } 7 else 8 { 9 return n + sum(n - 1); 10 } 11 }