Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	n, _ := strconv.Atoi(read())
	sum := 1
	for i := n; i > 0; i-- {
		sum *= i

	}
	fmt.Println(sum)
}

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

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

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

int factorial(int n){
	int ans = 1;
	for(int i = n; i > 0; --i)
		ans *= i;
	return ans;
}

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

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


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

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

typedef long long int ll;

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

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

C++: #include <iostream>

using namespace std;
using LL = long long;

int main() {
    int n;
    cin >> n;
    LL ans = 1;

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

    cout << ans << endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int y;
    int x = 1;
    cin >> y;

    while(y != 1)
    {
        x = x*y;
        y--;
    }
    cout << x << endl;
}

C++: #include<iostream>

using namespace std;

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>

#define ll long long int

using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n;
  ll ans=1;
  int i;
  cin>>n;

  for(i=n;i>1;i--)
    ans*=i;
  cout<<ans<<endl;

}

C++: #include <iostream>

using namespace std;

int main()
{
    int y;
    unsigned int x = 1;
    cin >> y;

    while(y != 1)
    {
        x = x*y;
        y--;
    }
    cout << x << endl;
}

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

int main() {
	int n;
	cin >> n;
	long long int fact = 1;
	while (n > 0) {
		fact *= n;
		n--;
	}
	cout << fact << 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 << "\n";
return 0;
}

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

using namespace std;

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

	scanf("%lld",&n);
	for(int i = 2; i <= n; i++){
		ans *= i;
	}
	printf("%lld\n",ans);

	return 0;
}

C++: #include <stdio.h>

long long int ans[22] ;

void init ( ) ;

int main ( )
{
	long long int s ;
	init ( ) ;
	while ( scanf ( "%lld" , &s ) == 1 ) {
		printf ( "%lld" , ans[s] ) ;
	}
	return 0 ;
}

void init ( )
{
	ans[0] = 0 ;
	ans[1] = 1 ;
	for ( long long int i = 2 ; i <= 20 ; i++ ) {
		ans[i] = ans[i-1] * i ;
	}
}

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

long long 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("%lld", f(n));
}

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


int factorial_recursive(int n);

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


cin>>n;

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

	result1 = factorial_recursive(n);

	cout<<result1<<endl;
	return 0;

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

C++: #include <bits/stdc++.h>
#include <vector>
using namespace std;
int f(int a){
	if(a == 0 || a == 1)
		return 1;
	else
		return a * f(a-1);
}
int n;
int main(){
	cin >> n;
	cout << f(n) << "\n";
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(void){
  unsigned int n;
  unsigned int fact=1;
  cin>>n;
  while(n) fact*=n--;
  cout<<fact<<endl;
  return 0;
}

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

int main()
{
 long long int a[25]={1};
 a[0]=0;
 a[1]=1;
 for (int i=2;i<25;i++)
 {
     a[i]=a[i-1]*i;
 }

 int n;

 while (cin >> n)
 {
 cout << a[n] << "\n";
 }

 return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()

#define fora(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define ford(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define foraf(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define fordf(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)

#define vcitr vector<int>::iterator
#define vcsitr vector<string>::iterator
#define mapcitr map<char, int>::iterator
#define mapsitr map<string, int>::iterator

typedef long long ll;

int iINF = 2147483647;
ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }

ll k(ll n) {
	if (n <= 1) return 1;
	return n * k(n - 1);
}

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

C++: #include<stdio.h>

int n,output=1;

int main(){
	scanf("%d",&n);
	for(int i=n;n>=2;n--){
		output*=n;
	}
	printf("%d",output);
	return 0;
}

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

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

int main(){
	
	int a,b,c,d;
	
	cin >> a;
	
	for(b=1; b<=a; b++){
		c = 1;
		for(d=b; d>=1; d--){
			c *= d;
		}
	}
	
	cout << c << '\n';
	
	return 0;
}

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

int main(){
  long long int f=1;
  int i;

  cin >> i;

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

  cout << f << "\n";

  return 0;
}