View Code of Problem 30

#include <stdio.h>
#include <stdlib.h>
#include<ctype.h>
#include<string.h>
#include<math.h>

int main()
{
	long a, sum;
	while (scanf("%d",&a)!=EOF)
	{
		sum = a / 2 * (1 + a);
		printf("%d\n", sum);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 30