HDU 1001 Sum Problem

题目链接:HDU 1001 Sum Problem

题目大意:
计算(1+2+...+n)

题解:

#include <iostream>
using namespace std;
int main() {
    long long n;
    while (cin >> n)
          cout << (1 + n) * n / 2 << endl << endl;
    return 0;
}
原文地址:https://www.cnblogs.com/IzumiSagiri/p/13810014.html