6 条题解
-
1ppip (NFLS) LV 8 MOD @ 2021-11-03 21:53:39
迭代器好耶!
#include <bits/stdc++.h> using namespace std; int main() { istream_iterator<long long> in(cin),end; ++in; cout<<accumulate(in,end,0LL); return 0; }
-
02021-02-15 20:31:53@
我ee,会的题都有题解,不会的一道没有
#include <iostream> using namespace std; int main() { long long n,i;cin>>n; long long a[n]; for(i=0;i<n;i++)cin>>a[i]; long long h=0; for(i=0;i<n;i++) h+=a[i]; cout<<h; return 0; }
-
02020-08-08 20:32:06@
#include<bits/stdc++.h> using namespace std; int main(){ unsigned long long n , sum = 0; cin >> n; unsigned long long a[n]; for(int i = 0 ; i < n ; i++){ cin >> a[i]; sum += a[i]; } cout << sum; return 0; }
-
02020-07-31 15:31:06@
#include<bits/stdc++.h> using namespace std; int a[1322233]; int main() { int n; cin>>n; long long int s=0; for(int i=1;i<=n;i++){ cin>>a[i]; s+=a[i]; } cout<<s; return 0; }
-
02020-07-25 23:01:13@
这题像 A+B 吗?
#include <iostream> using namespace std; typedef long long Num; int main() { Num n,danielLele=0ll,duLiu; cin>>n; if(!n){cout<<"0"<<endl;return 0;} for(Num i=1ll;i<=n;i++) { cin>>duLiu; danielLele+=duLiu; } cout<<danielLele<<endl; return 0; }
-
02020-07-24 15:23:08@
这题和你谷的
A+B
很像。代码:include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int temp, ans = 0; for(int i = 0; i < n; i++) { cin >> temp; ans += temp; } cout << ans; return 0; }
- 1