fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int i,a,n,x;
  5. a=1;
  6. i=1;
  7. scanf("%d",&n);
  8. x=n;
  9. while(i<=x)
  10. {
  11. a=a*n;
  12. n--;
  13. i++;
  14. }
  15. printf("%d",a);
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
Standard output is empty