Files
hanyixuanten ac9df32e58
Check cpp / md pair / Check md headers (push) Failing after 2s
new file: P10815.cpp
2026-10-23 10:43:08 +00:00

25 lines
533 B
C++

#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
x = 0;
bool fu = 0;
char c = getchar_unlocked();
while ((c < '0' || c > '9') && c != '-')
c = getchar_unlocked();
if(c=='-') fu=1, c=getchar_unlocked();
while (c>='0' && c<='9'){
x = 10*x+c-'0', c = getchar_unlocked();
}
x=((fu)?-1:1)*x;
}
int main(){
int n, ans=0;
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
int x;
read(x);
ans+=x;
}
printf("%d\n", ans);
return 0;
}