#20859: ac c++


yp10870939 (etydhtet fyh ryj jye uotrh tr...)

School : 臺北市私立延平高級中學
ID : 105778
IP address : [223.136.2.193]
Last Login :
2025-03-17 07:43:57
e339. 前綴和練習 | From: [175.181.153.240] | Post Date : 2020-03-14 12:29

#include <iostream>
using namespace std;
int main() {
long long int t, i, r = 0;
cin >> t;
while (t--) {
cin >> i;
res += i;                                                                                                                                                                                                                                 k
cout << r << ' ';
}
return 0;
}

 
#21167: Re:ac c++


1083307 (1083307)

School : 元智大學
ID : 114871
IP address : [49.216.138.214]
Last Login :
2020-10-20 16:58:53
e339. 前綴和練習 | From: [218.32.46.140] | Post Date : 2020-04-23 13:17

#include
using namespace std;
int main() {
long long int t, i, r = 0;
cin >> t;
while (t--) {
cin >> i;
r += i;
cout << r << " ";
}
return 0;
}



 
ZeroJudge Forum