Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := nextInt()
	f := 1
	for i := 1; i <= n; i++ {
		f *= i
	}
	fmt.Println(f)
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define sz size()
#define all(A)    A.begin(), A.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define f0(i,b)   for(int i=0;i<(b);i++)
#define f1(i,b)   for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
#define mod 1000000007

#define forr(i,n)    for(i=0; i<n; i++)
#define whilee(i,t)  while(i!=t)
#define  sl(a)  scanf("%lld",&a)
#define  pl(a)  printf("%lld",a)

//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);
//scanf("%d",&x);
//printf("%d\n",x);

//vector <int> A;
//deque <int> A;
//queue <int> A;
//stack <int> A;
//set <int> A;
//map <int,int> A;
//pair <int,int> A ;
//vector <pair <int,int>> A ;
//char ch;
//string S, T, U;
ll factorial(ll n)
{
    if(n==1)
    {
        return 1;
    }
    else
    {
        return n*factorial(n-1);
    }
}
ll i, j, k, a, b, c, d, f, g, h, l, m, n, p, q, r, s, t, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, cnt=0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    scanf("%lld",&n);
    printf("%lld\n", factorial(n));

    return 0;
}

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