标签:title bottom ica print ref ons Once file ase
http://acm.hdu.edu.cn/showproblem.php?pid=2132
代码:
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; long long sum[maxn]; int main() { sum[0] = 0; for(long long i = 1; i < maxn; i ++) { if(i % 3 == 0) sum[i] = sum[i - 1] + i * i * i; else sum[i] = sum[i - 1] + i; } int x; while(~scanf("%d", &x)) { if(x < 0) break; else printf("%lld\n", sum[x]); } return 0; }
标签:title bottom ica print ref ons Once file ase
原文地址:https://www.cnblogs.com/zlrrrr/p/9451327.html