#include <iostream> using namespace std; int main() { int n; while (cin >> n) { cout << (1 + n)*n / 2 << endl; } }
Double click to view unformatted code.