Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanLines)
	n, _ := strconv.Atoi(read())
	sum := 1
	for i := n; i > 0; i-- {
		sum *= i

	}
	fmt.Println(sum)
}

C++: #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);

using namespace std;
double f[23];
int main() { _
int n,i;
f[0]=1.;
for(i=1;i<23;++i)f[i]=f[i-1]*(double)i;
while(~scanf("%d",&n))printf("%.0lf\n",f[n]);
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){

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

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

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

long long func(int n)
{
	return (n > 1) ? n * func(n - 1) : 1;
}
int main()
{
	int n;
	cin >> n;

	cout << func(n) << endl;
}

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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



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

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

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

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

  return 0;
}

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

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

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 main(void)
{
	int n,i;
	long long int sum;

	sum=1;

	scanf("%d",&n);

	for(i=1;i<=n;i++){
		sum*=1;
	}
	
	printf("%lld\n",sum);

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)


using namespace std;

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

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

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

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

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

using namespace std;

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

	int ans = 1;

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

	cout << ans << endl;

	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {

	int n;
	long long int x=1;

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

	return 0;

}

C++: #include <iostream>

using namespace std;

int main(void){

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

C++: #include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

int main()
{
    long long n;
    
    do
    {
    cin >> n;
    
    }while(n>20);
    
    long long x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    
    cout<< sum << endl;
    
    return 0;
}

C++: #include <iostream>
using namespace std;
long long f(int n)
{
	return(n?n*f(n-1):1);
}
int main()
{
	int n;
	cin >> n;
	cout << f(n) << endl;
	
	return 0;
}

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

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int n;
scanf("%d",&n);
unsigned long long int ans=1;
for(;n>0;n--){
ans=ans*n;
}
printf("%lld\n",ans);
return 0;
}

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

using namespace std;

int main ()
{
    long long x,y;
    y=1;

    cin>>x;

    if(1<= x <= 20)
    {
        for(int i = x; i>0; i--)
        {
            y*=i;
        }
        cout<<y<<endl;
    }

    return 0;
}

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

C++: #include <iostream>

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

C++: #include <iostream>

using namespace std;

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

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

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

int main(){
  int n;
  cin>>n;
  if(n<1||n<20)break;
  cout<< factorial(n)<<endl;
}

C++: #include<stdio.h>
#include <string>
#include <iostream>
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<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
#define pi 3.14159
using namespace std;

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

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

	

	return 0;
}

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

int main(void)
{
  int a,b,i;
  cin >> a;
  for(i=a;i>0;i--)
  {
    b*=i;
  }
  cout << b;
  return 0;
}

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

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

C++: #include "iostream"
#include "cmath"

int main(int argc, char const *argv[])
{
  int n;
  double factorial=1;
  std::cin >> n;
  for (int i = 1; i <= std::abs(n); ++i)
    factorial *= i;
  if (n<0) std::cout << -1*factorial << std::endl;
  else std::cout << factorial << std::endl;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n;
	unsigned long long int re = 1;
	
	cin >> n;
	while(n >= 2) {
		re *= n;
		n--;
	}
	
	cout << re << endl;
	
	return 0;
	
}#include <iostream>

using namespace std;

int main() {
	int n;
	int re = 1;
	cin >> n;
	while(n >= 2) {
		re *= n;
		n--;
	}
	
	cout << re << endl;
	
	return 0;
	
}

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