#include <iostream>
using namespace std;

int factorial(int n);

int main() {
    int n;
    cin >> n;
    cout << factorial(n) << endl;
    return 0;
}

int factorial(int n) {
    if (n == 0 || n == 1) {
        return 1;
    }
    return n * factorial(n-1);
    
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: