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;
		n = n-1;
	}
	cout << x<<endl;
	return 0;

}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int n;
	cin >> n;
    long int x = 1;
    for(int i=0; i<n; ++i){
		x = x*(i+1);
    }
    printf("%d",&x);
	return 0;
}

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

using namespace std;

int main()
{
  function<long long(int)> const fact = [&]( int n ) -> long long { return n==0 ? 1 : fact( n-1 ) * n; };
  int i; cin >> i;
  cout << fact( i ) << endl;
}

C++: #include <iostream>

using namespace std;
typedef long long ll;

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

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

C++: 
// C++ program to compute factorial of big numbers
#include<iostream>
using namespace std;

// Maximum number of digits in output
#define MAX 100

// This function multiplies x with the number
// represented by res[].
// res_size is size of res[] or number of digits in the
// number represented by res[]. This function uses simple
// school mathematics for multiplication.
// This function may value of res_size and returns the
// new value of res_size
int multiply(int x, int res[], int res_size)
{
    int carry = 0;  // Initialize carry

    // One by one multiply n with individual digits of res[]
    for (int i=0; i<res_size; i++)
    {
        int prod = res[i] * x + carry;

        // Store last digit of 'prod' in res[]
        res[i] = prod % 10;

        // Put rest in carry
        carry  = prod/10;
    }

    // Put carry in res and increase result size
    while (carry)
    {
        res[res_size] = carry%10;
        carry = carry/10;
        res_size++;
    }
    return res_size;
}

// This function finds factorial of large numbers
// and prints them
void factorial(int n)
{
    int res[MAX];

    // Initialize result
    res[0] = 1;
    int res_size = 1;

    // Apply simple factorial formula n! = 1 * 2 * 3 * 4...*n
    for (int x=2; x<=n; x++)
    {
        res_size = multiply(x, res, res_size);
    }

    for (int i=res_size-1; i>=0; i--)
    {
        printf("%d",res[i]);
    }
}

// Driver program
int main()
{
    int n;
    scanf("%d",&n);
    factorial(n);
    return 0;
}

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, int mod){ return n ? n * factorial(n-1, mod) % mod : 1; }

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

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

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

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

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

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int f(int n){
	int sum;

	if(n==0||n==1){
		return 1;
	}else{
			return n*f(n-1);
	}
}

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

	int n;

	scanf("%d", &n);

	printf("%d", f(n));
}

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

int factorial(int n){
  if(n > 0){
    return n*factorial(n-1);
  } else {
    return 1;
  }
}

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

C++: #include <iostream>

using namespace std;

int main(void) {
	int i;
	unsigned int in;

	cin >> in;
	for(i=in;i>1;i--) {
		in*=i-1;
	}
	cout << in << endl;

	return 0;
}

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

C++: #include<iostream>
#include<string>
#include <stdio.h>
#include <math.h>
#include <cctype>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
int main(){
	long long int ans;
	int n;
	cin>>n;
	ans=1;
	for(int i=1;i<=n;i++){
		ans*=i;
	}
	cout<<ans<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <functional>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

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

	reep(i, 2, n)
		a *= i;
	printf("%lld\n", a);
}

C++: #include <iostream>

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    long sum = 1;
    
    for(int i = 1; i <= n; i++)
    {
        sum = sum * i;
    }
    
    cout << sum << endl;
    
    return;
}

int main()
{
    Solution();
    return 0;
}

C++: #include <iostream>
#define Lint long int
using namespace std;

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

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

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

C++: #include<stdio.h>

int f(int x){
  
  if( x == 0 || x == 1)
    return 1;

  return  x * f(x-1);
}

  int main(void){
    int n;

    scanf("%d",&n);

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

    return 0;
  }

C++: #include<stdio.h>

int step(int s,long long a){
	if(s==0)return a;
	return step(s-1,a*s);
}

int main(){
	int n;
	scanf("%d",&n);
	printf("%lld\n",step(n,1));
	return 0;
}

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

using namespace std;

int main()
{
  unsigned int n;
  scanf("%ud",&n);
  int l = n;
  for(int i = 1;i < l;i++){
    n *=(l-i);
  }
  if(n ==0)
    n = 1;
  printf("%ud",n);
  return 0;
}