题解
查看原帖
题解
1361794
Wangyumo2016楼主2025/8/4 10:15
#include <bits/stdc++.h>
using namespace std;
const int maxn = (1 << 20);
char *p1, *p2, buf[maxn];
#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++)
int read() {
	long long f = 1, k = 0;
	char c;
	while (!isdigit(c = gc()))if (c == '-')f = -1;
	while (isdigit(c))k = k * 10 + c - 48, c = gc();
	return f * k;
}
long long n, s, x;
int main() {
	n = read();
	for (int i = 1; i <= n; i++) {
		x = read();
		s += x;
	}
	cout << s;
	return 0;
}
2025/8/4 10:15
加载中...