fork download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int i,j,n,t,temp,m,x;
  5. char a[200];
  6. scanf("%d",&t);
  7. while(t--)
  8. {
  9. scanf("%d",&n);
  10. a[0]=1;
  11. m=1;
  12. temp=0;
  13. for(i=2;i<=n;i++)
  14. {
  15. for(j=0;j<m;j++)
  16. {
  17. x=a[j]*i+temp;
  18. a[j]=x%10;
  19. temp=x/10;
  20. }
  21. while(temp)
  22. {
  23. a[m]=temp%10;
  24. temp=temp/10;
  25. m++;
  26. }
  27. }
  28. for(i=m-1;i>=0;i--)
  29. printf("%d",a[i]);
  30. printf("\n");
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0s 3300KB
stdin
1 95
stdout
10329978488239059262599702099394727095397746340117372869212250571234293987594703124871765375385424468563282236864226607350415360000000000000000000000