标签:
1 #include <iostream> 2 3 using namespace std; 4 long long sum(long long n); 5 6 int main() 7 { 8 long long n; 9 while(cin >> n) 10 cout << sum(n) << endl << endl; 11 return 0; 12 } 13 14 long long sum(long long n) 15 { 16 return (1 + n) * n / 2; 17 }
标签:
原文地址:http://www.cnblogs.com/Artprog/p/4851780.html