View Code of Problem 30

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


int main()
{
	int n=1;/*
	if(freopen("c:\\input.txt", "rt", stdin)==0)
	{
	}*/

	scanf("%d",&n);
	while (n>0)
	{
		printf("%ld\n",n*(n+1)/2);
		scanf("%d",&n);
	}
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 30