View Code of Problem 30

#include<stdio.h>
#include<math.h>
int main(){
	int  a,b,p,q,s=0,n,i;
	while(scanf("%d",&n)!=EOF){	
		for(i=0;i<=n;i++){
			s+=i;
		}
		printf("%d\n",s);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 30