#include<stdio.h> int main() { int a,b,c=0,d=1; for(a=1;a<=10;a++) { for(b=1;b<=a;b++) { d*=b; } c=c+d; d=1; } printf("%d\n",c); return 0; }
#include <stdio.h> unsigned foo( unsigned n ) { unsigned s = 0; for( ; n!=0; --n ) s = (s+1)*n; return s; } int main( void ) { printf( "%u\n", foo(10) ); }
#include<stdio.h> int main() { int a,b = 1,c = 0; for(a=1;a<=10;a++) { b *= a; c += b; } printf("%d\n",c); return 0; }