fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n, k=1, f=1;
  5. scanf("%d", &n);
  6. if (n > 0) {
  7. while (n >= k) {
  8. f = f * k;
  9. k = k + 1;
  10. }
  11. printf("%d", &f);
  12. }
  13. if (n<0){
  14. return 1;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 5272KB
stdin
3
stdout
-606921020