fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);
  7. cout.tie(0);
  8.  
  9. int n;
  10. cin >> n;
  11.  
  12. long long result = 1; // Faktorialın nəticəsi üçün uzun tipdən istifadə edirik
  13. for (int i = 1; i <= n; i++) {
  14. result *= i; // Faktorialın hesablanması
  15. }
  16.  
  17. cout << result << "\n"; // Nəticəni ekrana veririk
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
0