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

C++: #include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)

#define MP       make_pair
#define PB       push_back
#define ALL(x)   (x).begin(),(x).end()

const int INF = 1<<29;
const double EPS = 1e-9;
double zero(double d){
  return d < EPS ? 0.0 : d;
}

typedef long long LL;
typedef pair<int,int> P;


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(7);

  int n;
  cin >> n;
  
  LL res=1L;
  REP(i,n){
    res *= i+1;
  }

  cout << res << endl;

  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int fctrl(int n){
    if(n==0||n==1)return 1;
    else return n*fctrl(n-1);

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

    long long  rslt = fctrl(n);

    cout<<rslt<<endl;

    return 0;
}

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

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

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

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

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

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

long long fuct(int n){
	long long m;
	if(n==0) return 1;
	m = fuct(n-1);
	return m * n;
}

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

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

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

using namespace std;

double fact(double x);

int main(void) {
	double n;
	while(1) {
		cin >> n;
		if(cin.eof())		break;
		
		printf("%.0f\n", fact(n));
	}
	
	return 0;
}

double fact(double x) {
	if(x == 0) {
		return 1;
	}
	return x * fact(x - 1);
}

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 <bits/stdc++.h>
using namespace std;

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

C++: #include<iostream>

using namespace std;

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

C++: #include <iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;

int main()
{
    int  a=0,b=0,i=0;
    cin >> a;
    b=1;
    for(i=0;i<a;i++){
        b=b*(i+1);

    }

    cout << b << endl;



    //cout << endl;

return 0;

}

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

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const double INF = 1e12;


int main(){
	int n;
	cin>>n;
	LL res=1;
	REP(i,n)res*=(i+1);
	cout<<res<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

long long fact(int n);

int main ()
{
	int n;

	cin >> n;

	cout << fact(n) << endl;

	return 0;
}

long long fact(int n)
{
	if(n == 1)    return 1;
	else if(n == 0)    return 0;

	return (n * fact(n - 1));
}

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

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

int fact(int number) {
    long r=0;
    for(int i=number; i>=1; i--)
{
r = r*i;
}
return r;
}
 
int Main() {

int num=0;
long result =0;

cin >> num;

result = fact(num);

cout<<result;

    
}