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>
using namespace std;
int main(void){
    long long int t=1 ;
    int loop;
    cin >> loop;
    for(int i=1;i<=loop;i++) {
        t *= i;
    }
    cout << t << endl;
}

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

using namespace std;

int main()
{
	int num,i;
	cin >> num;
	long long ret = 1;
	for( i = 1; i <= num; i++ ) {
		ret *= i;
	}

	cout << ret << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

typedef long long ll;

ll f(ll x){
    if(x == 1) return 1;
    return x*f(x-1);
}

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

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

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

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  a,b=1,i;
    cin>>a;
           for(i=2;i<=a;i++)
    {       b=i*b;


    }

    printf("%lld\n",b);

    return 0;

}

C++: #include<stdio.h>

int main(void){
 
   int n,i,ans=1;

   scanf("%d",&n);

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


   printf("%d\n",ans);

return 0;
}

C++: #include<stdio.h>

using namespace std;


long long int factriolf(long long int n)
{
    long long int f,i;
    f = 1;
    for (i = 1; i<=n;i++)
    {
      f = f *i;
    }
    return f;
}

int main ()
{
    long long int n;
    scanf("%lld",&n);

long long int r = factriolf(n);

printf("%lld\n",r);

return 0;
}

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

using namespace std;

int fact(int x);

int main(void) {
	int n;
	while(1) {
		cin >> n;
		if(cin.eof())		break;
		
		cout << fact(n) << endl;
	}
	
	return 0;
}

int fact(int x) {
	if(x == 0) {
		return 1;
	}
	return x * fact(x - 1);
}

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

C++: #include<iostream>
#include<vector>
#include<iomanip>

using namespace std;

vector<int> bignum(1,1);
const int e9=1000000000;

void fact(int n);
void multi(int num);
void output();

int main()
{
	int n;
	cin>>n;
	fact(n);
	return 0;
}

void fact(int n)
{
	for(int i=1;i<=n;i++)
	{
		 multi(i);
	}
	output();
}

void multi(int num)
{
	long long temp;
	for(int i=bignum.size()-1;i>=0;i--)
	{
		temp=(long long)(bignum[i])*num;
		bignum[i]=temp%e9;
		if(i==bignum.size()-1&&temp/e9>0)
		{
			bignum.push_back(temp/e9);
			continue;
		}
		bignum[i+1]+=temp/e9;
	}
}

void output()
{
	for(int i=bignum.size()-1;i>=0;i--)
	if(i==bignum.size()-1)
	{
		cout<<bignum[i];
	}
	else//上位を0で詰める
	{
		cout<<setfill('0')<<setw(9)<<right<<bignum[i];
	}
	cout<<endl;
}

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

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int num, fac=1;

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

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

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

int main()
{
	
	int num;
	unsigned long long total=1;
	
	cout << "Please enter a number : ";
	cin >> num;
	
	int temp = num;
	int score[num];

	for(int i=0; i<temp; i++)
	{
		score[i]=num;
		--num;
	}
	
	for(int i=0; i<temp; i++)
	{
		total*=score[i];
	}
	
	printf("%llu", total);
	return 0;
}

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

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

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

int fact(int n)
{
	return n<=1 ? 1 : n*fact(n-1);
}

int main()
{
	int n;
	scanf("%d",&n);
	cout << fact(n) << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main() {
	
	int m=1,n;
	cin>>n;
	if(n<13){
		for(int i=1;i<=n;i++)m=m*i;
		cout<<m<<endl;
	}
	if(n==13)cout<<"6227020800"<<endl;
	if(n==14)cout<<"87178291200"<<endl;
	if(n==15)cout<<"1307674368000"<<endl;
	if(n==16)cout<<"20922789888000"<<endl;
	if(n==17)cout<<"355687428096000"<<endl;
	if(n==18)cout<<"6402373705728000"<<endl;
	if(n==19)cout<<"121645100408832000"<<endl;
	if(n==20)cout<<"2432902008176640000"<<endl;
	return 0;
}

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

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

int main(){
  int n, i;

  cin >> n;

  for(i = n - 1;i >= 1;i--){
    n = n * i;
  }

  cout << n << endl;

  return 0;
}

C++: #include <stdio.h>

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

int main() {
	long n;
	
	scanf("%d", &n);

	printf("%ld\n", factorial(n));

	return 0;
}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

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

C++: #include <stdio.h>

int main()
{
  int n;
  int i;
  long a=1;

  scanf("%d", &n);
  for(i=2; i<=n; i++){
    a*=(long)i;
  }
  printf("%ld\n", a);

  return 0;
}

C++: #include<stdio.h>
void main()
{
int a,b=1;
clrscr();
printf("Please enter any number to find its factorial\n");
scanf("%d",&a);
while(a>1)
{
b=b*a;
a--;
}
printf("factorial is %d",b);
getch();
}

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

C++: #include <stdio.h>
typedef unsigned long long LL;
int main(){
    unsigned int num;
    LL factorial=1;
   scanf("%d", &num);
    for(;num > 0; num--){
        factorial *= num;
    }
printf("%lld", factorial);
    return 0;
}

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

int main () {
    int n, a=1,i;
    cin >> n:
    for(i=n;i>1;i--) {
        a *= n;
    }
    cout << a << endl;
}

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

using namespace std;

int main(){
int n;
string fac[21] = {"1","1","2","6","24","120","720","5040","40320","362880","3628800","39916800","479001600","6227020800","87178291200","1307674368000"
			,"20922789888000","355687428096000","6402373705728000","121645100408832000","2432902008176640000"};

cin >> n;
cout << fac[n] << endl;

return 0;
}

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

C++: #include <iostream>

using namespace std;

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