?? 2303.cpp
字號:
/* This Code is Submitted by wywcgs for Problem 2303 on 2006-08-02 at 22:49:03 */
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long int64;
int main()
{
int n, i;
while(scanf("%d", &n) != EOF && n != 0) {
int64 sum = 0, unit = 0;
for(i = 0; i < n; i++) {
int a; scanf("%d", &a);
sum += a; unit += abs(sum);
}
printf("%lld\n", unit);
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -