Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	scanner.Scan()
	i, e := strconv.Atoi(scanner.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func factorial(n int) int {
	if n == 1 {
		return 1
	}
	return n*factorial(n-1)
}
func main() {
	scanner.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(factorial(n))
}

C++: #include <iostream>

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

private:
    /**
    * @fn int calc(int target)
    * @brief 階乗を計算する
    * @param[in] target ターゲット
    * @return int 階乗
    */
    long long 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(long long target) const;
};

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

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

    return target * calc(target - 1);
}

bool Control::executeEx() const
{
    int input = 0;
    long long 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(long long 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 kaijo(int n) {
  int ans = 1;
  for(int i = n; i > 0; i--) {
    ans *= i;
  }
  return ans;
}

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

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

int main(){
   int i,n;
   int ans=1;
   cin>>n;
   
   for(i=n;i>1;i--) ans*=i;
   
   printf("%d\n",ans);
   return 0;
}

C++: #include <iostream>

using namespace std;

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

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

    return 0;
}

C++: #include <iostream>
#include <functional>

using namespace std;

int main()
{
  function<int(int)> const fact = [&]( int n ) -> int { return n==0 ? 1 : fact( n-1 ) * n; };
  int i; cin >> i;
  cout << fact( i ) << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;

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

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

unsigned long factorial(unsigned long n){
    
    unsigned long ans = (n>1)? n*factorial(n-1):1;
    
    return  ans;
}


int main (int argc, char const* argv[]){
    unsigned long n, ans;
    
    cin >> n;
    
    ans = factorial(n);
    cout << ans << endl;
    
    return 0;
}

C++: void main(a,i){
long long n=scanf("%d",&a);
for(i=0;i++<a;)n*=i;
printf("%llu\n",n);
}

C++: #include <iostream>
using namespace std;
typedef long long int lli;

lli fact(lli a){
  if(a==0)
    return 1;
  else
    return a*fact(a-1);
}

int main(){
  lli c;
  cin >> c;
  cout << fact(c) << endl;
}

C++: #include <iostream>

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

int main(void)
{
	int n;
	std::cin >> n;
	std::cout << func(n) << std::endl;
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main()
{
	int n;
	long long tmp = 1;
	
	scanf("%d", &n);
	
	for (int i = n; i >= 1; i--){
		tmp *= i;
	}
	
	printf("%lld\n", tmp);
	
	return (0);
}

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

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

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int i,j,n,sum;
	scanf("%d",&n);
	sum=1;
	for(i=2;i<=n;i++) sum=sum*i;
	printf("%d\n",sum);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	int in,i;

	cin >> in;
	for(i=in;i>1;i--) {
		in*=i-1;
	}
	cout << in << endl;

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<vector>
#include<queue>
#include<list>
#include<stack>
#include<algorithm>
#include<cmath>
#include<memory>

using namespace std;

long long fact( long long n )
{
  if ( n == 1 ) return 1;

  return n * fact( n - 1 );
  
}

int main()
{
  long long n;
  cin >> n;

  cout << fact( n ) << endl;
  
  return 0;
}

C++: main(i){printf("%d\n",rand());}

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

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

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	unsigned int out;
	int n;
	while(cin >> n){
		out = 1;
		for(int i = 0; i <= n; i++){
			if(i){
				out *= i;
			}
		}

		cout << out << endl;
	}

	return 0;
}

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

int main()
{
	int x;
	unsigned long long int ret=1;
	cin >> x;
	for(int i=1;i<=x;i++)
		ret*=i;
	if(!x)ret=0;
	cout << ret << endl;
}

C++: #include<iostream>
#include<cstdio>

using namespace std;

int main()
{
  unsigned int n;
  scanf("%ud",&n);
  int l = n;
  for(int i = 1;i < l;i++){
    n *=(l-i);
  }
  printf("%ud",n);
  return 0;
}

C++: #include<stdio.h>

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

int main()
{
    int n;
    long long f;


    while(scanf("%d",&n)==1)
    {
       if(n<=0)
            printf("no factorial.\n");
        else

        {
            f=factorial(n);
            printf("%lld\n",f);
        }
    }
    return 0;

}

C++: #include<stdio.h>
#include<string.h>
int main()
{
    int n;
    int f[50];
    int i, j, s, c;
    while (scanf ("%d", &n)??EOF)
    {
        memset(f,0,sizeof(f));
        f[0]=1;
        for (i=2; i<=n; i++)
        {
            c=0;
            for (j=0; j<50; j++)
            {
                s=f[j]*i+c;
                f[j]=s%10;
                c=s/10;
            }
        }
        for (i=49; i>=0; i--) if (f[i]!=0) break;
        for (j=i; j>=0; j--) printf ("%d", f[j]);
        printf ("\n");
    }
    return 0;
}

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

int main(){
    unsigned int num;
    unsigned long long factorial=1;
    cin >> num;
    for(;num > 0; num--){
        factorial *= num;
    }
    cout << factorial;
    return 0;
}