fork download
  1. #include<stdio.h>
  2. double FACT(short int n) ;
  3. int main()
  4. {
  5. short int X,i=0;
  6. int NUM[100];
  7. scanf("%d",&X);
  8. if(1<=X<=100){
  9. while(i<X){
  10. scanf("%d",&NUM[i]);
  11. i++;
  12. }
  13. }
  14. i=0;
  15. while(i<X){
  16. if(1<=(NUM[i])<=100){
  17. printf("%.0lf\n",FACT(NUM[i]));
  18. }
  19. i++;
  20. }
  21. return 0;
  22. }
  23.  
  24. double FACT(short int n){
  25. short int i;
  26. double sum=1;
  27. for(i=1;i<=n;i++){
  28. sum*=i;
  29. }
  30. return(sum);
  31. }
Runtime error #stdin #stdout 0s 2688KB
stdin
4
1
2
5
3
stdout
Standard output is empty