fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, fact = 1;
  7. cin >> n;
  8.  
  9. for(int i = 1; i <= n; i++)
  10. {
  11. fact = fact * i;
  12. }
  13.  
  14. cout << fact;
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty