Go: package main

import (
        "fmt"
)

func main() {
        var n int
        fmt.Scanf("%d", &n)
        fmt.Println(fact(n))
}

func fact(n int) (f uint64) {
        if n < 2 {
                return uint64(1)
        } else {
                return fact(n-1) * uint64(n)
        }
}

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

C++: #include<iostream>

using namespace std;

long fac(int n)
{
    long res = 1;
    for(int i = n; i > 0; i--)
        res = res * i;
    return res;
}

int main()
{
    int n;
    cin >> n;

    if(n < 1 || n > 20)
        cout << "Error" << endl;
    else
        cout << fac(n) << endl;

    return 0;
}

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

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

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

return 0;

}

C++: #include<cstdio>
#include<iostream>
using namespace std;
#define ll long long 
ll fac(ll n);
int main(){
  ll n;
  cin >> n;
  cout << fac( n ) << endl;
}
ll fac(ll n){
  if(n == 1)return 1;
  return n * fac(n-1);
}

C++: #include<stdio.h>

using namespace std;


int factriolf(int n)
{
    int f,i;
    f = 1;
    for (i = 1; i<=n;i++)
    {
      f = f *i;
    }
    return f;
}

int main ()
{
int n;
    scanf("%d",&n);

int r = factriolf(n);

printf("%d\n",r);

return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: #include <iostream>

using namespace std;

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

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

   return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1234567;
const ll INF=1000000010;
const ll LINF=1000000000000000010LL;
const int MAX=10000010;
const double EPS=1e-3;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
//階乗
ll fact(int n){
    if(n==1){
        return 1;
	}
    ll res=n;
    res*=fact(n-1);
    return res;
}
int main(){
	int n;cin>>n;
	cout<<fact(n)<<endl;
	return 0;
}

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

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;

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

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

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

}

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

C++: #include<iostream>

using namespace std;

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

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

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

C++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

typedef long long ll;

ll fn(int n){
	if(n == 1)
		return 1;
	return n * fn(n-1);
}

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

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


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

    }
      printf("%lf",sum);


    return 0;
}

C++: #include <iostream>

using namespace std;

unsigned long factorial(unsigned long n)
{
	unsigned long result = 1;
	for (unsigned long i = n; i > 0; --i) {
		result *= i;
	}
	return result;
}

int main()
{
	unsigned long value = 0;
	cin >> value;
	cout << factorial(value) << endl;

	return 0;
}

C++: #include<stdio.h>
int factorial(int x);

int main(void)
{
	int n, ans;
	scanf("%d", &n);
	ans = factorial(n);
	printf("%d\n", ans);
	
	return 0;
}

int factorial(int x){
	if(x > 0)
	return x * factorial(x - 1);
	else
	return 1;
}

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

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

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

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

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

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

C++: #include <stdio.h>

int main(void) {
	int n;
	int fact=1;
	char buf[256];
	
	fgets(buf, sizeof(buf), stdin);
	sscanf(buf, "%d", &n);
	
	//if (n<1 || n>20) return 1;
	
	for (int i=n; i>=2; i--) {
		fact*=i;
	}
	
	printf("%d\n", fact);
	
	return 0;
}

C++: #include <iostream>

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

C++: #include<cstdio>


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

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

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

int main(){

  int n;

  cin>>n;
  cout<<f(n)<<endl;

  return 0;
}

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

long long factorial(long long n){   // 再帰関数
  if(n==1){
    return n;
  }else{
    n*=factorial(n-1);
  }
}

int main(){
  int n;
  cin >> n;

  if(n>=1 && n<=20){
    cout << factorial(n) << endl; // 再帰
  }else{
    cout << "計算できません。" << endl;
  }

  return 0;
}

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

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

unsigned long Factorial(unsigned long n){
    if(n!=1){
        return n*Factorial(n-1);
    }else{
        return 1;
    }
}

int main(){
    unsigned long n;
    cin >> n;

    cout << Factorial(n) << endl;
return 0;
}

C++: #include<stdio.h>

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

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

int main(void){
    int n, x;
    cin >> n;
    x = 1;
    while(n != 1){
        x *= n;
        n--;
    }
    cout << x << endl;

    return 0;
}

C++: #include<iostream>

using namespace std;
long long int faktorial(long long int n){
	if (n==0)return 1;
	return n*faktorial(n-1);
}
long long int n,z;
int main (){



while(cin>>n){

	  if(n>=0&&n<21){
		z = faktorial(n);
	
	
cout<<z<<endl;}}

return 0;
	
}