Information
- ID
- 6760
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 390
- Accepted
- 128
- Uploaded By
用个sum
储存和,枚举每一个元素然后累加就好了。
#include<iostream>
#define int long long
using namespace std;
int n,a,sum;
signed main(){
cin>>n;
for(int i=1;i<=n;i++)cin>>a,sum+=a;
cout<<sum;
return 0;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.