fork download
  1. #include <stdio.h>
  2. int kaijo (int x){
  3. int total=1;
  4. for(int i=x;i>=1;i--){
  5. total=total*i;
  6. }
  7. return total;
  8. }
  9.  
  10. int main(){
  11. for (int i=1;i<=10;i++){
  12. printf("%d!=%d\n",i,kaijo(i));
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
1!=1
2!=2
3!=6
4!=24
5!=120
6!=720
7!=5040
8!=40320
9!=362880
10!=3628800