#include <cstdio>
int main() {
int N, sum = 0, temp;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d", &temp);
sum += temp * 10 * (N - 1) + temp * (N - 1);
}
printf("%d", sum);
return 0;
}
#include <cstdio>
int main() {
int N, sum = 0, temp;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%d", &temp);
sum += temp * 10 * (N - 1) + temp * (N - 1);
}
printf("%d", sum);
return 0;
}
本文标题:PAT 1056 组合数的和 (15 分)
本文链接:https://www.haomeiwen.com/subject/ilvxhctx.html
网友评论