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) {
    int n;
    long factorial = 1;
    
    cin >> n;
    
    for(int i = 1; i <= n; ++i) {
        factorial *= i;
    }
    
    cout << factorial << endl;
}

C++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

ll calc(ll i){
  if(i==1) return 1;
  
  return i*calc(i-1);
}


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

C++: #include <iostream>

using namespace std;

int main(){
   
   int num,fact=1;

   cin>>num;

   for(int a=1;a<=num;a++)
   {
       fact = fact * a;
   }
 cout<<fact;

  return 0;
   
    
}

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int main(){
	int n,ans=1;
	cin>>n;
	fd(n,0){
		ans*=i;
	}
	cout<<ans<<endl;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
    int n;
    double x=1;
    cin >> n;
    for (int i=1;i<=n;i++){
        x*=i ;
    }
    // cout << x << endl;
    printf("%g",x);
}

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

int main(int argc, char **argv)
{
 int n, tmp;
 while(cin >> n){
 tmp = 1;
 while(n > 1){
  tmp *= n;
  n--;
 }
 cout << tmp << endl;
 }
 return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 5;

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

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

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

//0019
int main(){
	long long int x, f;

	cin >> x;
	f=x;
	while(--x){
		f*=x;
	}
	cout << f <<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

int main(){

  int n;

  cin >> n;

  cout << solve(n) << endl;

}

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

int64_t factorial( int64_t n ) {
	return n > 1 ? n*factorial( n-1 ) : n;
}

int main() {
	ios_base::sync_with_stdio( false );

	int n;
	cin >> n;

	cout << factorial( n ) << endl;
}

C++: #include<iostream>

using namespace std;

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

int main(){

	int n;

	cin >> n;

	cout << n << "!=" << f(n);

	return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

float factorial(float n);

int main()
{
    long long n;
    
    do
    {
    cout<< "Enter value : " ;
    cin >> n;
    
    }while(n>20);
    
    cout<< factorial(n) << endl;
    
    return 0;
}

float factorial(float n)
{
    int x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    return sum;
}

C++: #include <iostream>
unsigned int factorial(int i)
{
  if (i <= 1) return 1;
  else        return i * factorial(i - 1);
}
int main()
{
  int n;
  std::cin >> n;
  std::cout << factorial(n) << std::endl;
  return 0;
}

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

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

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

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

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

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

#define loop(i,a,b) for(int i=a ;i < b ; i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(void){
	int a;
	int sum=1;
	cin>>a;
	
	loop(i,1,a+1)sum*=i;
	cout<<sum<<endl;
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    long long answer = 1`;
    int n;
    cin >> n;

    for (int i = n; i != 0; i--) {
            answer *= i;
    }
cout << answer;
return 0;
}

C++: #include<stdio.h>

int main()
{
	int n,x,kaizyo=1;
	scanf("%d",&n);

	if(n==1)
	{
		kaizyo=1;
		printf("%d\n",kaizyo);
	}
	else if(n<=20)
	{
		for(x=1;x<=n;x++)
		{
			kaizyo*=x;
		}
		printf("%d\n",kaizyo);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
        unsigned long n, ans = 1;

        cin >> n;
        for (unsigned long i = n; i > 0; i--) {
                ans *= i;
        }
        cout << ans;

        return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,s,i;
	scanf("%d",&n);
	s=1;
	for(i=2;i<=n;i++){
		s=s*i;
	}
	printf("%d\n",s);
	return 0;
}

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

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

C++: #include<iostream> 

using namespace std;

int func(int x) {
	return x <= 1 ? 1 : x * func(x - 1);
}

int main() {
	int n;

	cin >> n;

	cout << func(n) << endl;

	return 0;
}

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

unsigned long long int fact(unsigned long long int n)
{
	if(n==0)
		return 1;
	return n*fact(n-1);
}

int main()
{
	unsigned long long int n;
	while(cin >> n)
		cout << fact(n) << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, res;
    res = 1;

    cin >> n;

    for (int i = 2; i <= n; i++) {
        res *= i;
    }

    cout << res << endl;

    return 0;
}

C++: #include<iostream>
#define rep(i,s,n)for(int i=s;i<n;i++)
using namespace std;
using ll=long long;
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n,i;
  ll sum;
  cin >> n;
  sum=1;
  rep(i,1,n+1)sum*=i;
  cout << sum <<endl;
  return 0;
}

C++: #include <iostream>

long fact(int n);

int main()
{
    int n;
    std::cin >> n;

    std::cout << fact(n) << std::endl;

    return 0;
}

long fact(int n)
{
    long ans = 1;
    while (n--) {
        ans *= (n + 1);
    }

    return ans;
}

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

using namespace std;

int main()
{

  int n,i,temp;
  cin >> n;
  temp = n;
  
  for(i=1;i<temp;i++){
    n = n * (temp-i);
  }
  
  cout <<n<<endl;

  return 0;
}

C++: #include<stdio.h>
#define KETA 119
int main(void){

    int a[KETA];
    int b[KETA];
    int i,x,kuri=1,kaisuu;
    
    for(i=0;i<KETA;i++) a[i]=0;
    scanf("%d",&kaisuu);
    for(x=1;x<=kaisuu;x++){
        for(i=KETA-1;i>=0;i--){
            b[i]=(a[i]*x+kuri)%10;
            kuri=(a[i]*x+kuri)/10;
        }
        
        for(i=0;i<KETA;i++) a[i]=b[i];
        for(i=0;i<KETA;i++) b[i]=0;
    }
	    for(i=0;a[i]==0&&i<KETA;i++);
        if(i==12) printf("0");
        for(;i<KETA;i++){
            printf("%d",a[i]);
        }
        printf("\n");
        
    return 0;
}