杭电ACM1001 发表评论 热度3,236 度A+所属分类:ACM 杭电ACM1001 #include <iostream> int main() { using namespace std; long int n,m; long int s; while (cin >> n) { if (n%2 == 0) { s = n/2*(n+1); } else { s = (n+1)/2*n; } cout << s << endl << endl; } return 0; } 赞 0 赏 分享