Go: package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	rs := 1
	for i := 1; i <= n; i++ {
		rs *= i
	}
	fmt.Println(rs)
}

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

long long int f(int x){
	if(x==0){
		return 1;
	}else{
		return x*f(x-1);
	}
}

int main(){
	int a;
	long long int r;
	while(cin >> a){
		r=f(a);
		cout << r << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;
double factorial;
double x;
double y = 1;
int main()
{
        cin >> factorial;

        while(factorial != 0)
        {
            x = factorial;
            y = y*x;
            factorial--;

        }
        cout << y;
}

C++: #include <iostream>
main(){long long n,i;for(std::cin>>n,i=n;i>1;n*=--i);std::cout<<n<<"\n";}

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

template <int N>
struct factorial {
    static const long long int value = N * factorial<N - 1>::value;
};

template <>
struct factorial<0> {
    static const long long int value = 1;
};

int main() {
    int n;
    std::array<long long int, 21> arr;
    arr[1] = factorial<1>::value;
    arr[2] = factorial<2>::value;
    arr[3] = factorial<3>::value;
    arr[4] = factorial<4>::value;
    arr[5] = factorial<5>::value;
    arr[6] = factorial<6>::value;
    arr[7] = factorial<7>::value;
    arr[8] = factorial<8>::value;
    arr[9] = factorial<9>::value;
    arr[10] = factorial<10>::value;
    arr[11] = factorial<11>::value;
    arr[12] = factorial<12>::value;
    arr[13] = factorial<13>::value;
    arr[14] = factorial<14>::value;
    arr[15] = factorial<15>::value;
    arr[16] = factorial<16>::value;
    arr[17] = factorial<17>::value;
    arr[18] = factorial<18>::value;
    arr[19] = factorial<19>::value;
    arr[20] = factorial<20>::value;
    
    std::cin >> n;
    std::cout << arr[n] << std::endl;

    return 0;
}

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;
}