标签:求和 length c++ actor ++ index pre cpp 入门
int factorial(int num) {
if (num == 1) {
return 1;
}
return num * factorial(num - 1);
}
int arraySum(int* arr, int length, int index) {
if (index == length) {
return 0;
}
return arr[index] + arraySum(arr, length, index + 1);
}
标签:求和 length c++ actor ++ index pre cpp 入门
原文地址:https://www.cnblogs.com/esrevinud/p/11980275.html