... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-12149 :: Feynman

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

return 0 ;
}