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<math.h>
#include <iomanip>
using namespace std;
int main() {
	int n;
	int x=1;
	cin >> n;
	while (true) {
		if (n == 0) {
			break;
		}
		else 
			x = n*x;
		n = n-1;
	}
	cout << x<<endl;
	return 0;

}

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


int factorial_loop(unsigned int n);

int main(void)
{
unsigned int n;
unsigned int result1;


cin>>n;

if(0<n&&n<21) ;
else return 0;

	result1 =factorial_loop(n);

	cout<<result1;
	return 0;

}
int factorial_loop(unsigned int n) {
    int result = 1;
    int k;

    for(k = 1; k <= n; k++) {
        result *= k;
    }
    return result;
}

C++: #include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

int kaizyou(int n,int sum);

int n;
int ans=1;

int main(){
	while(cin >> n){
		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>
#include <cstdio>
using namespace std;

long factorial(int num) {
    if(num == 1) return(1);
    return(num * factorial(num - 1));
}

int main(void) {
    int num; cin >> num;
    cout << factorial(num) << endl;
    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("%ld\n", sum);
	
	return (0);
}

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

C++: //
//  main.cpp
//  kyougi
//
//  Created by 寺林 一旭 on 2018/08/27.
//  Copyright © 2018年 寺林 一旭. All rights reserved.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <map>
using namespace std;
int main() {
    
    long num;
    int inputValue;
    vector<int> list;
  
    while(cin >> num) //getline(cin, num))
    {
        long ans=1;
        for( int i = 1; i <= num ; i++)
        {
            ans = ans * i;
        }
        cout << ans << endl;
      //  cout << digit << endl;
   //     cout << a-b <<endl;
    }
  
    
    return 0;
}

C++: #include <stdio.h>

int fac(int x){
    if(x>1){
        return x*fac(x-1);
    }
    return 1;
}

int main(){
    int n;
    scanf("%d", &n);
    printf("%d", fac(n));
    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;
	long long int ans=1;
	cin>>n;
	fd(n,0){
		ans*=i;
	}
	cout<<ans<<endl;
}

C++: #include<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
#define pi 3.14159
using namespace std;

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

int main() {
	long long int n;
	cin >> n;
	cout << fact(n);

	

	return 0;
}

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

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

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

C++: #include <iostream>

using namespace std;

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

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

int main()
{
  int a;
  cin >> a;
  int ans = 1;
  for(int i=a; i>0; i--){
    ans = ans*i;
  }
  cout << ans << endl;

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
long long f(int n)
{
    if(n==1)return 1;
    else return n*f(n-1);
}
int main()
{
    int n;
    while(cin>>n)
        cout<<f(n)<<endl;

    return 0;
}

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

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

C++: #include<iostream>

int main()
{
	int n;

	int s=1;

	std::cin >> n;

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

	std::cout << s << '\n';
}

C++: #include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string.h>
#include <deque>
#define REP(i,j,n) for(int i=j;i<n;i++)
#define SORT(x) sort(x.begin(),x.end())

using namespace std;



int main() {
	int n,sum=1;
	cin >> n;
	while (n > 1 ){
		sum *= n;
		n--;
	}

	cout << sum << endl;
	return 0;
}

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

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

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

template<class T> T factorial(T n){ return n ? n * factorial(n-1) : 1; }

int main()
{
	ll n;
	cin >> n;
	cout << factorial(n) << endl;
}

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

int main(){

long long int ans=1,n;

 cin >> n;

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

 cout << ans << endl;
}

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

int main(){
	int n, i;
	long long f = 1;
	cin >> n;

	for( i=1;i<=n;i++ ){
		f*=i;
	}
	cout << f << endl;
	return 0;
}