View Code of Problem 30

#include<iostream>
using namespace std;

int main()
{
    int a;
    while (cin >> a) {
	   int sum = (1 + a)*a / 2;
	   cout << sum << endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 30