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 <iostream>
using namespace std;
typedef unsigned long ulong;

ulong factorial(int n){
	ulong s = 1;
	while (n){
		s *= n--;
	}
	return s;
}

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

C++: main()printf("2432902008176640000\n");return 0;

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

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <string>
#include <cmath>
#include <complex>
#include <functional>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cstdlib>
#include <cctype>

#define REP(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rp(i,c) rep(i,(int)c.size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(u) (u).rbegin(),(u).rend()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl
#define v_delete(a,b) (a).erase(remove((a).begin(), (a).end(), b), (a).end())
#define v_unique(a) (a).erase(unique((a).begin(), (a).end()), (a).end())
#define VV(T) vector<vector< T > >
#define init(a,b) memset((a), (b), sizeof((a)))
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e10,EPS=1e-9;


template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}

template <class T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
template <class T> void input(T* a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
typedef pair<int,int> pii;

inline bool IN(int x, int y, int w, int h)
{
    return 0 <= x && x < w && 0 <= y && y < h;
}


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

}

C++: #include<cstdio>
int main(){
    int n;
    long long ans=1;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        ans*=i;
    }
    printf("%lld\n",ans);
}

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

long long factorial(long long n){   // 再帰関数
  if(n==1){
    return 1;
  }else{
    return 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;

using ULLint = unsigned long long int;

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

C++: #include <cstdio>
using namespace std;
int main(){
    int n;unsigned long ans=1;
    scanf("%d", &n);
    while(n!=1){ans*=n;--n;}
    printf("%lu\n",ans);
    return 0;
}

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

int main(){
  long long a[21],b;
  a[1]=1;
  for(int i=2;i<20;i++)a[i]=a[i-1]*i;
  cin>>b;
  cout<<a[b]<< endl;
  return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
 
int main() {
	long long int n, sum=1;
	cin>>n;
	for(int i=0;i<n;i++){
		sum=sum*(n-i);
	}
	cout<<sum<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
signed main(void){
	long long a=1,b;
	cin>>b;
	for(long long i=1;i<=b;i++)
		a*=i;
	cout<<a<<endl; 
}

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

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

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

double factorial(int x) {

  if(x != 1)
    return x * factorial(x-1);
  else if(x == 1)
    return 1;
}

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

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

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

C++: #include<stdio.h>

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

int main(void){
	int n,ans;
	scanf("%d",&n);
	ans=fact(n);
	printf("%d\n",ans);

return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999



//??????
ll factmemo[/*num*/]={1};
ll fact(int n){
    if(factmemo[n]!=0)return factmemo[n];
    return factmemo[n] = n*fact(n-1);
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int  a,b=1,i;
    cin>>a;
           for(i=2;i<=a;i++)
    {       b=i*b;


    }

    printf("%lld\n",b);

    return 0;

}

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

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

C++: #include <iostream>

using namespace std;

int main(){
  unsigned long int n = 1,m;

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

  cout << n ;

  return 0;
}

C++: #include <stdio.h>

int i, n;
long long res;

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

C++: #include<bits/stdc++.h>
using namespace std;
long long int serch(long long int n)
{
    if(n==1)return n;
    return n*serch(n-1);
}
int main()
{
    long long int n;
    cin>>n;
    n=serch(n);
    cout<<n<<endl;
}

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;


long long i, num, fact=1;



int main()
{
    cin >> num;

    for(i = 1; i <= num; i++)
    {
    	fact = fact * i;
    }

    cout << fact << endl;
    system("pause");
}

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

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

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

C++: #include<iostream>

using namespace std;

int calcurate(int cal[20],int i,int krg,int j) {
	if (j == 1) {
		/*for (int i = 1; i <= 20; i++) {
			cout << cal[i] << endl;
		}*/
		return cal[20];
	}
	cal[j] = (cal[j] * i);
	cal[j] += krg;
	if (cal[j] >= 10) {
		int tmp;
		tmp = int(cal[j] / 10);
		cal[j] %= 10;
		krg = tmp;	/*繰り上げ*/

	}
	else {
		krg = 0;
	}
	calcurate(cal, i, krg, j - 1);


}

int main() {
	int n, cal[21] = {0};
	cal[20] = 1;
	cin >> n;
	int krg = 0;
	for (int i = 1; n >= i; i++) {
		int j = 20;
		calcurate(cal, i, krg, j);


	}
	int x = 1;
	while (true) {
		if (cal[x] != 0) {
			break;
		}
		x += 1;
	}
	for (int i = x; i <= 20; i++) {
		cout << cal[i];
	}
	cout << endl;


}