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 <iostream>
using namespace std;
int main(){
    int n;
    double x=1;
    cin >> n;
    for (int i=1;i<=n;i++){
        x*=i ;
    }
    cout << x << endl;
}

C++: #include <iostream>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		int n;
		cin >> n;
		if ( cin.eof() )
			break;

		long long f = 1;
		for ( int i = 2; i <= n; i++ )
		{
			f *= i;
		}

		cout << f << endl;
	}

}

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

long long kaijo(int n){
	if(n <= 1)
		return 1;
	return (long long)n*kaijo(n-1);
}

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

C++: #include<iostream>
using namespace std;
typedef long long int long64;

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

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

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

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

int main(int argc, char *argv[]){
	long long int n;
	cin>>n;
	cout<<fact(n)<<endl;
    return 0;
}

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

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

#define loop(i,a,b) for(int i=a ;i < b ; i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(void){
	int a;
	while(cin>>a){
	
	long long int sum=1;
	loop(i,1,a+1)sum*=i;
	cout<<sum<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>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;
typedef long long Int;

Int fact(Int n){
    if(n == 1){
        return 1;
    }
    return n * fact(n-1);
}

int main(){

    Int n;

    cin >> n;

    cout << fact(n) << endl;

    return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int i,n,x=1;
    scanf("%d",&n);
    if(n>0)
    {
        for(i=n;i>0;i--)
            x=x*i;
    }
    if(n<0)
    {
        for(i=n;i<0;i++)
            x=x*i;
        if(n%2!=0)
            x=x*-1;
    }
    if(n==0)
    {
        x=x*n;
    }
    printf("%d\n",x);
    return 0;
}

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

C++: #include <iostream>
typedef unsigned long long ULL;
int factorial(ULL n)
{
    if (n == 0) {
        return 1;
    } 
    else {
        return n * factorial(n-1);
    }
}
int main()
{
    ULL n;
    std::cin  >> n;
    std::cout << factorial(n) << std::endl;
}

C++: nclude<iostream>
using namespace std;
int function(int n){
  if(n > 1)
    return n * function(n-1);
  else
    return 1;
}

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

C++: #include <iostream>

using namespace std;

int fact(long long n);

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

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

C++: // 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	long long a[n + 1];
	a[0] = 1;
	for(int i = 1; i <= n; i++)a[i] = a[i - 1] * i;
	cout << a[n] << '\n';
	return 0;
}
// Write Here

C++: #include<iostream>

using namespace std;

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

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

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

C++: #include<stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <sstream>
#include<math.h>
#include <algorithm>
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;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    Int ans=1;
    for(int i=1; i<=n; i++) ans*=i;
    cout<<ans<<endl;
    return 0;
}

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