fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void)
  4. {
  5. int n,i=1,fact=1;
  6.  
  7. do
  8. {
  9. scanf("%d",&n);
  10. printf("input n(n>0):%d\n",n);
  11. }
  12. while(n<=0);
  13.  
  14. do
  15. fact*=i++;
  16. while (i <= n);
  17. printf("%d!=%d\n",n,fact);
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5288KB
stdin
6
stdout
input n(n>0):6
6!=720