View Code of Problem 30

#include<stdio.h>
main()
{
	int m,n,i;
	while(scanf("%d",&n)!=EOF)
	{
		m=0;
		for(i=1;i<=n;i++)
			m+=i;
		printf("%d\n",m);
	}
}

Double click to view unformatted code.


Back to problem 30