Monday, May 2, 2011

10302 - Summation of Polynomials


#include<stdio.h>
int main()
{
    register unsigned long n,sum;
    freopen("in.txt","r",stdin);
    while(scanf("%lu",&n)==1)
    {
        sum=(n*(n+1))>>1;
        sum=sum*sum;
        printf("%lu\n",sum);
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.