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 <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)):((m)-(n))),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define loop for(;;)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;
typedef vector<int> vi;
typedef vector<string> vs;
typedef map<string,int> Dictionary;
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

string m[]={"1","1","2","6","24","120","720","5040","40320","362880","3628800","39916800","479001600","6227020800","87178291200","1307674368000","20922789888000","355687428096000","6402373705728000","121645100408832000","2432902008176640000","51090942171709440000"};

int main() {

  int n;cin>>n;cout<<m[n]<<endl;

  return 0;
}

C++: #include <stdio.h>
int main()
{
	unsigned long long int x,z,i,fac=1;
	scanf("%llu",&x);
	for(i=1;i<=x;i++)
	{
		fac=fac*i;
	}
	printf("%llu",fac);
}

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

using namespace std;

long long int kaijo(int a){
	if(a==0){
		return 1;
	}
	else {
		return a*kaijo(a-1);
	}
	
}

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

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

C++: #include<iostream>

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

C++: #include<iostream>

using namespace std;
long long sum(int n){
    if(n==1) return 1;
    if(n==2) return 2;
    return n*sum(n-1);
  
    }
    
    int main(){
        int n;
        cin>>n;
        cout<<sum(n)<<endl; 
        system("pause"); 
        return 0;
    }

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

long long factorial(int n) {

	return (n > 0 ? n*factorial(n - 1) : 1);

}

int main() {
	int  n;
	scanf_s("%d", &n);
	
	printf("%lld \n", factorial(n));

	return 0;
}

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

long long factorial(long long n) {
   if (n == 0L)
      return 1L;
   else
      return (n * factorial(n-1));
}


int main()
{
    long long num;
    cin >> num;
    cout << (long long) factorial((long long) num);
    return 0;
}

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 = ans * i;
	}
	cout << ans << endl;
}

C++: using namespace std;

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

int main(){
	long int a,r;
	while(cin >> a){
		r=f(a);
		cout << r << endl;
	}
	return 0;
}

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

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

C++: #include <iostream>

int main() {
  int n;

  std::cin >> n;

  int factorial = 1;
  while (n > 0)
    factorial *= n--;

  std::cout << factorial << std::endl;

  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,i;
	long long int sum;

	sum=1;

	scanf("%d",&n);

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

	printf("%lld\n",sum);

	return 0;
}

C++: #include<stdio.h>
int kaizi(int a){
if(a>0)
return (a*kaizi(a-1));
else
return 1;}
int main(){
int n;
while(scanf("%d",&n)!=EOF)
printf("%d\n",kaizi(n));
return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
	cout << 2432902008176640000 << endl;
	return 0;
}

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

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

C++: #include <iostream>

using namespace std;

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

C++: #include <stdio.h>
int main(){
    int n;
while(scanf("%d",&n)==1){

if(n==0)printf("1\n");
if(n==1)printf("1\n");
if(n==2)printf("2\n");
if(n==3)printf("6\n");
if(n==4)printf("24\n");
if(n==5)printf("120\n");
if(n==6)printf("720\n");
if(n==7)printf("5040\n");
if(n==8)printf("40320\n");
if(n==9)printf("362880\n");
if(n==10)printf("3628800\n");
if(n==11)printf("39916800\n");
if(n==12)printf("479001600\n");
if(n==13)printf("6227020800\n");
if(n==14)printf("87178291200\n");
if(n==15)printf("1307674368000\n");
if(n==16)printf("20922789888000\n");
if(n==17)printf("355687428096000\n");
if(n==19)printf("121645100408832000\n");
if(n==20)printf("2432902008176640000\n");


            }

return 0;


}

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



main(){

  int n,i;
  int out;

  

  cin >> n;
  out = 1;
  for(i=n;i>0;i--){
    
    out *= i;

  }

  cout << out << endl;

  return 0;
  
}

C++: #include <cstdio>

using namespace std;

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

C++: #include <iostream>

int main() {
  int n;

  std::cin >> n;

  long long int factorial = 1;
  while (n > 0)
    factorial *= n--;

  std::cout << factorial << std::endl;

  return 0;
}

C++: #include<iostream>

using namespace std;

int Main()
{
     int counter, n, fact = 1;

     cin>>n;

     for (int counter = n; counter >= 1; counter--)
     {
         fact = fact * counter;
     }

     cout<<fact;
 }

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

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

C++: #include <iostream>

using namespace std;

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