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>
#include<cmath>
#include<cstdio>

using namespace std;

int main(){
	int n;

	while (cin >> n){

		double ans = 1;

		while (n){
			ans *= n;
			n--;
		}

		printf("%.0f\n", ans);
	}

	return 0;
}

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

long factorial(int n){
	long 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<bits/stdc++.h>
using namespace std;


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

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

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

C++: #include<iostream>


using namespace std;

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

return 0;
}

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

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

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

int 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 <iostream>
#include <cstdio>
using namespace std;
int main(){
    int n;
	cin >> n;
    long long int x = 1;
    for(int i=0; i<n; ++i){
		x = x*(i+1);
    }
    cout << x;
	return 0;
}

C++: #include<iostream>

using namespace std;

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

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

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

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

int main(){
  int n;
  cin >> n;
  cout << factorial(n);
  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<<f<<"\n";
return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    cin >> n;
    int ans = 1;
    rep(i, 1, n + 1) ans *= i;
    cout << ans << endl;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
  int a;
  cin >> a;
  cout << tgamma(a+1) << 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("%d", &n);
	
	printf("%lld\n", factorial(n));

	return 0;
}

C++: #include<iostream>

int main(){
  long long int n,ans=1;
  std::cin >> n;
  if(n==0){
    std::cout << 1 <<std::endl;
    return 0;
  }
  while(n>0){
    ans *= n;
    --n;
  }
  std::cout << ans << std::endl;
}

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

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

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

C++: n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);}

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

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

C++: #include <iostream>

using namespace std;
long long fact(int n) {
  if (n < 1 || n > 20) return 0;
  if (n == 1) return 1;
  else return fact(n - 1) * (long long)n;
}

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

C++: #include <iostream>

unsigned Factorial(unsigned n)
{
	int ans=n;
	while(--n>0)
	{
		ans *= n;
	}
	return ans;
}

int main()
{
	unsigned n;
	std::cin >> n;

	std::cout << Factorial(n);
}

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

using namespace std;

void solve()
{
	int n;
	cin >> n;
	if(n == 1)
	{
		cout << 1 << endl;
		return;
	}
	vector<int> a(1000);
	for(int i = 1; i < 1000; ++i)
	{
		a[i] = 0;	
	}
	a[0] = 1;

	for(int i = 2; i <= n; ++i)
	{
		int buf = 0;
		for(int j = 0; j < a.size() - 1; ++j)
		{
			int temp = 0;
			temp = a[j] * i + buf;
			buf = temp / 10;
			a[j] = temp % 10;
		}
	}
	reverse(a.begin(), a.end());
	bool flag = false;
	for(int b = 0; b < a.size(); ++b)
	{
		if(a[b] != 0)
		{
			flag = true;
		}
		if(flag)
		{
			cout << a[b];
		}
	}
	cout << endl;
}

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

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

C++: #include <iostream>

using namespace std;

int main(int argc, *char argv[]) {
    int answer = 1;
    int n = argv[1];

    for (int i = n; i != 0; i--) {
            answer *= i;
    }
cout << answer;
return 0;
}

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

C++: #include <iostream>

using namespace std;

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

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

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

  return 0;
}

C++: #include <iostream>

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