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>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

long fact(int n);

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

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

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

C++: #include<stdio.h>
int main()
{

    int n,i,fact=1;
    scanf("%d",&n);
    i=1;
    while (i<=n)
    {
        fact=fact*i;
        i++;
    }
    printf("%d",fact);
    return 0;
}

C++: #include<iostream>
using namespase std;
int main(){
int n;

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

C++: #include<stdio.h>

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

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

unsigned long Factorial(unsigned long n){
    if(n!=1){
        return n*Factorial(n-1);
    }else{
        return 1;
    }
}

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

    cout << Factorial(n);
return 0;
}

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

int main() {
	int n,ans=1;
	while (cin >> n) {
		if (n <= 20 && n >= 0) {
			for (int a = 1; a <= n; a++) {
				ans = ans*a;
			}
			cout << ans << endl;
		}
	}
}

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

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

C++: #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <sstream>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <climits>
#include <fstream>

using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second
using namespace std;

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

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

__int64 fact(int num);
int input_int();

int main()
{
	cout << fact(input_int()) << endl;
	return (0);
}

__int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); }

int input_int()
{
	int in;
	cin >> in;
	return (in);
}

C++: #include <iostream>

int main()
{
    int n;
    std::cin >> n;
    unsigned long long int s = 1;
    for(std::size_t i = 2; i <= n; ++i){
        s *= i;
    }
    std::cout << s << std::endl;
    return 0;
}

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

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

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

int main(void)
{
	int n;
	long long sum = 1;

	scanf("%d",&n);
	for(int f1 = 1; f1 <= n; f1++){
		sum *= f1;
	}

	printf("%lld\n", sum);
	return 0;
}

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

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

    cin>>n;
    for(int i=1;i<=n;i++)ans*=i;
    cout<<ans<<endl;

    return 0;
}

C++: #include<iostream>

using namespace std;

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

int main(){

	int n;

	cin >> n;

	cout << f(n);

	return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main(){
long i,j,k,c,n,f[21]={0};
f[1]=j=1;
cin>>n;
for(k=1;k<=n;k++){
c=0;
for(i=1;i<=j+1;i++){
f[i]=f[i]*k+c;c=f[i]/10;
if(c){
f[i]%=10;if(i+1>j)j++;
}
}
}
while(j>0)cout<<f[j--];
cout<<endl;
return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int ke(int x)
{
    if(x == 1)return 1;
    else return x*ke(x-1);
}
int main()
{
    int a;
    cin >> a;
    printf("%d\n",ke(a));
    return 0;
}

C++: #include <cstdio>

int main()
{
		int n;
			scanf("%d\n", &n);
				long long m = n;
					while(--n) m *= n;
						printf("%lld\n", m);
							return 0;
}

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

using namespace std;

int kaizyou(int n,int sum);

int n;
int ans=1;

int main(){
	while(cin >> n){
		ans = 1;
		kaizyou(n,ans);
		cout << ans << endl;
	}
}

int kaizyou(int n,int sum){
	if(n > 1){
		ans = sum * n;
		kaizyou(n - 1,ans);
	}

}

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

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


}

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

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

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

using namespace std;

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

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false


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

C++: #include <iostream>
//#include <fstream.h>
//#include <cstring>
using namespace std;

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

int main() {
  
  int n;

  cin >> n;

  cout << factorial(n) << "\n";

  return 0;
}

C++: #include<cstdio>

int main(){
	long long n,a = 1;
	scanf("%ld", &n);
	while(n){
		a *= n;
		n--;
	}
	printf("%ld\n", a);
	return 0;
}

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

C++: #include<iostream>

using namespace std;

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

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

C++: #include <iostream>

using namespace std;

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

	return factorial(n - 1) * n;
}

int main()
{
	int n;

	cin >> n;

	cout << factorial(n) << endl;

	return 0;
}

C++: #include <stdio.h>
#include <iostream>

int main(void)
{
long long a;
int n;

scanf("%d", &n);

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

std::cout << a << std::endl;

return (0);
}