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

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

C++: #include<iostream>
using namespace std;
int main(){
long long int x=1,s;
cin>>s;
while(s!=1){
x*=s;
s--;
}
cout<<x<<endl;
return 0;
}

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

int kaijo(int n);
unsigned long long ans;

int main(void)
{
    int n;
    scanf("%d", &n);
    
    kaijo(n);
    printf("%llu\n", ans);
    
}

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

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

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

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

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

typedef unsigned long long ull;
typedef long long ll;

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

using namespace std;

typedef pair<int ,int > P;

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

	


	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  ll res = 1;
  FOR(i, 1, n+1){
    res = res * i;
  }
  cout << res << endl;
	return 0;
}

C++: #include <stdio.h>
int main(){


         unsigned   long long int n,res;;
         int i;
            while(scanf("%llu",&n)==1){
                    res=1;

                for(i=2;i<=n;i++){
                    res=res*i;}
            printf("%llu\n",res);



            }

return 0;


}

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

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

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
//type
typedef long long ll;
#define pii pair<int, int>
#define vi vector<int>
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
#define ios cin.tie(0); ios::sync_with_stdio(false)
#define FIX(a) cout << fixed << setprecision(a)
//manip
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define fill(x, y) memset(x, y, sizeof(x))
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power(T a, T b)
{return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
template<typename T> T gcd(T a, T b) {if (b == 0) return a; return gcd(b, a % b);}
template<typename T> T lcm(T a, T b) {return a / gcd(max(a, b), min(a, b)) * b;} //先に割る!!
#define outa(a, n) rep(i, n) cout << a[i] << " "; cout << endl
#define out(a) cout << a << endl
ll factorial(int n) {if (n == 1) return 1; return n * factorial(n - 1);}
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0
//minimal required terms
//cast caution
//look constraints always



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

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

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

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

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

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

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

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
using namespace std;

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

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

C++: // @BEGIN_OF_SOURCE_CODE

#include <iostream>
#include <cstring>

using namespace std;

int main ()
{
    int n;

    scanf("%d", &n);

    long long fact = 1;

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

    cout << fact << endl;

    return 0;
}

// @END_OF_SOURCE_CODE

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 5;

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

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

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int ke(long long int x)
{
    if(x == 1)return 1;
    else return x*ke(x-1);
}
int main()
{
    long long int a;
    cin >> a;
    printf("%lld\n",ke(a));
    return 0;
}