You are viewing a single comment's thread. Return to all comments →
I tried it in pure C ...a world of pain! But here's the answer
int main(){ int n; long bign = 0; long bignn; scanf("%d",&n); long arr[n]; for(int arr_i = 0; arr_i < n; arr_i++){ scanf("%li",&arr[arr_i]); } for(int arr_i = 0; arr_i < n; arr_i++){ bign = bign + (arr[arr_i]) ; } printf("%ld\n", bign); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
A Very Big Sum
You are viewing a single comment's thread. Return to all comments →
I tried it in pure C ...a world of pain! But here's the answer
int main(){ int n; long bign = 0; long bignn; scanf("%d",&n); long arr[n]; for(int arr_i = 0; arr_i < n; arr_i++){ scanf("%li",&arr[arr_i]); } for(int arr_i = 0; arr_i < n; arr_i++){ bign = bign + (arr[arr_i]) ; } printf("%ld\n", bign); return 0; }