fork download
  1. #include <stdio.h>
  2. int kaijoh(int x){
  3. int r;
  4. if(x==1){
  5. return 1;
  6. }
  7. else{
  8. r=x*kaijoh(x-1);
  9. return r;
  10. }
  11. }
  12. int main(void) {
  13. int i;
  14. for(i=1;i<11;i++){
  15. printf("%d\n",kaijoh(i));
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5288KB
stdin
,i
stdout
126241207205040403203628803628800