Go: package main

import (
        "fmt"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        fmt.Println(fact(n))
}

func fact(n int) (f uint64) {
        if n < 2 {
                return uint64(1)
        } else {
                return fact(n-1) * uint64(n)
        }
}

C++: //↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑

long long upperfloor(long long n) {
	long long ans = 1;
	while (n) {
		ans *= n;
		--n;
	}
	return ans;
}

int main() {
	int n;
	cin >> n;
	cout << upperfloor(n) << endl;
}

C++: #include <iostream>

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

using namespace std;

int main(){
	long long int n;
	cin >> n;
	cout << factorial(n) << '\n' ;
}

C++: #include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())

#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
#define Dev 1000000007

// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
   int n;
   cin>>n;
   long long int ans = 1;
   for(int i=n;i>=1;i--){
       ans *= i;
   }
   cout << ans << endl;
   return 0;
}

C++: #include<iostream>
using namespace std;

int kaijo( int n ){
	if( n == 1 )	return 1;
	return n * kaijo(n-1);
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int n;
  unsigned long long int ans=1;
  cin >> n;
  for(int i=2;i<=n;i++) ans *= i;
  cout << ans << endl;
  return 0;
}

C++: #include <iostream>
#include <deque>
using namespace std;

class BigInt {
    static const int base = 10;
    public:
    deque<int> digits;
    BigInt() {
    }
    BigInt(int n) {
        for (;n; n /= base)
            digits.push_back(n % base);
    }
    BigInt operator +(const BigInt x) const {
        BigInt res;

        // add
        auto di = digits.begin(), xi = x.digits.begin(), end = digits.end();
        for (; di != end && xi != x.digits.end(); di++, xi++)
            res.digits.push_back(*di + *xi);

        // set rest
        if (di == end) {
            di = xi;
            end = x.digits.end();
        }
        for (; di != end; di++)
            res.digits.push_back(*di);

        res.normalize();

        return res;
    }
    void operator *=(const int x) {
        for (auto &a : digits)
            a *= x;
        normalize();
    }
    void normalize() {
        int carry = 0;
        for (int i = 0; i < size(); i++) {
            digits[i] += carry;
            carry = digits[i] / base;
            digits[i] %= base;
        }
        if (carry)
            digits.push_back(carry);
    }
    int size() const {
        return digits.size();
    }
    istream &read(istream &is) {
        digits.clear();
        cin.ignore();

        int s;
        while (s = cin.get(), isdigit(s))
            digits.push_front(s - '0');
        is.putback(s);

        return is;
    }
    ostream &write(ostream &os) const {
        for (auto di = digits.rbegin(); di != digits.rend(); di++)
            os << *di;
        return os;
    }
};

istream &operator>>(istream &is, BigInt &b) { return b.read(is); }
ostream &operator<<(ostream &os, const BigInt &b) { return b.write(os); }

int main()
{
    int n;
    BigInt factorial(1);
    cin >> n;

    for (; n; n--)
        factorial *= n;

    cout << factorial << endl;

    return 0;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

int fact(int n){
    if(n==1||n==0) return 1;
    return n*fact(n-1);
}
int main(){
    int n;
    cin >> n;
    cout << fact(n) << endl;
    return 0;
}

C++: #include<iostream>

__int64 fact( int n )
{
	if( n == 1 ) return 1;
	else return n * fact( n - 1 );
}

int main()
{
	int x;
	std::cin >> x;
	std::cout << fact( x ) << std::endl;

 	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
    int n,sum=1;
    cin>>n;
    for(int a=1;a<=n;a++)
    {

       sum=sum*a;
    }
    cout<<sum<<endl;
    return 0;
}

C++: #include<iostream>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(void)
{
  int i;
  int n;
  int sum=1;

  cin>>n;

  for(i=1;i<=n;i++)
    {
      sum*=i;
    }

  cout<<sum<<endl;

}

C++: #include <iostream>
using namespace std;

int main() {
	int n,ans;
	cin >> n;
	ans = n;
	for(int i=n-1;i>0;i--){
		ans = ans*i;
	}
	cout << ans;
	return 0;
}

C++: #include <iostream>

/**
* @brief ある整数の階乗を求める
*/
class Factorial
{
public:
    /**
    * @fn int getFactorial(int target)
    * @brief パラメータの階乗を取得する
    * @param[in] target ターゲット
    * @return int 階乗
    */
    int getFactorial(int target) const;

private:
    /**
    * @fn int calc(int target)
    * @brief 階乗を計算する
    * @param[in] target ターゲット
    * @return int 階乗
    */
    int calc(int target) const;
};

/**
* @brief コントロール
*/
class Control
{
public:
    /**
    * @fn  bool executeEx() const
    * @brief １つの整数を読み込み、その整数の階乗を出力する
    * @return bool 入力範囲内ならtrueを、そうでなければfalseを返す
    */
    bool executeEx() const;

private:
    /**
    * @fn bool check(int target) const
    * @brief 入力範囲をチェックする
    * @param[in] target チェック対象
    * @return bool 入力範囲内ならtrueを、そうでなければfalseを返す
    */
    bool check(int target) const;

    /**
    * @fn void read(int& data)
    * @brief 標準入力から読み込む
    * @param[out] data 入力整数
    */
    void read(int& data) const;

    /**
    * @fn void write(int target) const
    * @brief 標準出力に書き込む
    * @param[in] target 出力対象
    */
    void write(int target) const;
};

int Factorial::getFactorial(int target) const
{
    return calc(target);
}

int Factorial::calc(int target) const
{
    if (1 >= target)
        return 1;

    return target * calc(target - 1);
}

bool Control::executeEx() const
{
    int input = 0, output = 0;

    read(input);

    if (!check(input))
        return false;

    output = Factorial().getFactorial(input);

    write(output);

    return true;;
}

bool Control::check(int target) const
{
    static const int Min = 1;
    static const int Max = 20;

    if (Min > target || Max < target)
        return false;

    return true;
}

void Control::read(int& data) const
{
    std::cin >> data;
}

void Control::write(int target) const
{
    std::cout << target << std::endl;
}

/**
* @fn int main()
* @brief エントリポイント
*/
int main()
{
    if (!Control().executeEx())
        return 1;
}

C++: #include<iostream>
using namespace std;
int fact(int n)
{
	int prod = 1;
	for (int i = 1; i <= n; i++)
	{
		prod = prod * i;
	}
	return prod;
}
int main()
{
	int x;
	cin >> x;
	cout << fact(x) << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(int i;i<n;i++)
using namespace std;
int main(){
int a,s=1;
cin>>a;
r(i,a+1)if(i)s*=i;
cout<<s<<endl;
}

C++: #include<iostream>
using namespace std;
int main()
{
	long long a[21],b;
	a[0]=1;
	for(int i=1;i<=20;i++)a[i]=a[i-1]*i;
	cin>>b;
	cout<<a[b]<<endl;
	return 0;
}