题解 | #N个数之和#
N个数之和
https://www.nowcoder.com/practice/b007744eb43b4f7b95d9e87de01528db
int sum(int* left) { int sum_2 = 0; while (*left!='\0') { sum_2 += *left++; } return sum_2; } int main() { int a; int arr[50]={0}; scanf("%d", &a); for (int i = 0; i < a; i++) { scanf("%d", i + arr); } int sum_1 = sum(arr); printf("%d", sum_1); return 0; }