View Code of Problem 30

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

Double click to view unformatted code.


Back to problem 30