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++: #include <iostream>
using namespace std;

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

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

unsigned 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<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

#ifdef __BORLANDC__
	typedef __int64 ll;
#else
	typedef long long ll;
#endif


int main(){
	
	ll k = 1;
	int n;
	cin>>n;
	reps(i,1,n+1){
		k*=i;
	}
	cout<<k<<endl;
}

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

int main()
{
    int n, factorial = 1;
    cin >> n;

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

    cout << factorial << endl;

    return 0;
}

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

C++: #include <stdio.h>

int main(void) {
	int n;
	int fact=1;
	char buf[256];
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	if (n<1 || n>20) return 1;
	
	for (int i=n; i>=2; i--) {
		fact*=i;
	}
	
	printf("%d\n", fact);
	
	return 0;
}

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

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

C++: #include <cstdio>

int main(void)
{
	int n;
	int i;
	long sum;
	
	sum = 1;
	
	scanf("%d", &n);
	
	for (i = 1; i <= n; i++){
		sum *= i;
	}
		printf("%d\n", sum);
	}
	
	return (0);
}

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

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

C++: #include<iostream>
using namespace std;
 
long long factorial(long long n){   // 再帰関数
  if(n==1){
    return 1;
  }else{
    return n*=factorial(n-1);
  }
}
 
int main(){
  int n;
  cin >> n;
 
  if(n>=1 && n<=20){
    cout << factorial(n) << endl; // 再帰
  }
  else{
    cout << "計算できません。" << endl;
  }
 
  return 0;
}

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

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


int main()
{
    long long num;
    cin >> num;
    cout << (long long) factorial((long long) num);
    return 0;
}

C++: #include <iostream>

using namespace std;
// A x B = AB
int n,factorial;
int hasil = 1;
int main()
{
    cin >> n;
    if(n == 0)
    {
    cout << hasil;
    }
    while(n != 1)
    {
        factorial = n;
        n = n-1;
        hasil = hasil*factorial;

    }
    cout << hasil;
}

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

int main(){
  long long a[21],b;
  a[1]=1;
  for(int i=2;i<=20;i++)a[i]=a[i-1]*i;
  cin>>b;
  cout<<a[b]<< endl;
  return 0;
}

C++: #include <iostream>

int main() {
  int n;

  while(std::cin >> n) {

  unsigned int factorial = 1;
  while (n > 0)
    factorial *= n--;

  std::cout << factorial << std::endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
  int a;
  cin >> a;
  cout << tgamma(a + 1) << endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  long int n = 1,m;

  cin >> m;
  
  for(int i = 1;i <= m;i++){
    n *= i;
  }

  cout << n << endl;

  return 0;
}

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

int main()
{
    int n;
    int ans = 1;
    time_t start = clock();
    cin >> n;
    for(int c = n; c > 1; c--)
    {
        ans *=c;
    }
    cout << ans << endl;
    return EXIT_SUCCESS;
}

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

C++: #include<iostream>
using namespace std;
long long int loop(long long int);
int main(){
  int n;
  long long int ans;
  cin >> n;
  ans=loop(n);
  cout << ans << endl;
}

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

C++: #include <iostream>

using namespace std;

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

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

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

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

C++: # include <iostream>

using namespace std;

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

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