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>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<cfloat>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

#define PI (3.1415926535)
#define EPS (1e-10)

class BigInteger{
private:
  void fromStr(const std::string &str){
    int len = str.size();
    int tmp = 0;

    if(str[0] == '+'){
      sign = 1;
      tmp=1;
    }else if (str[0] == '-'){
      sign = -1;
      tmp=1;
    }else{
      sign = 1;
    }

    nums = std::vector<char>(len-tmp);
    for(int i=0;i<len-tmp;i++){
      nums[i]=str[len-1-i]-'0';
    }
  }
public:
  std::vector<char> nums;
  char sign;
  /*
   * constructors
   */
  BigInteger(){sign = 1;nums = std::vector<char>(1,0);}
  BigInteger(const std::vector<char> n,char s){
    nums = n;
    assert(s == 1 || s == -1);
    sign = s;
  }
  BigInteger(const std::string &str){
    fromStr(str);
  }
  BigInteger(int n){
    char buff[16];
    sprintf(buff,"%d",n);
    fromStr(std::string(buff));
  }

  int size() const{
    return nums.size();
  }
  int len() const{
    return nums.size();
  }

  char operator [] (int n) const{
    if(n<size() && n>=0)
      return nums[n];
    else
      return 0;
  }

  const std::vector<char> &vec() const{
    return nums;
  }
  char sig() const{
    return sign;
  }
  
  std::string toString() const{
    std::string ret="";
    if(sign == -1) ret+="-";
    for(int i=nums.size()-1;i>=0;i--){
      ret+=nums[i]+'0';
    }
    return ret;
  }

  void debug() const{
    std::cout << "sign =" << (int)sign << std::endl;
    for(int i=nums.size()-1;i>=0;i--){
      std::cout << (int)nums[i] << " ";
    }
    std::cout << std::endl;
  }
};

std::ostream &operator << (std::ostream &s , const BigInteger &i){
  return s << i.toString();
}

bool operator > (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as == 1 && bs ==1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != -1){
        if(a[i] != b[i]){
          return a[i] > b[i];
        }
      }
      return false;
    }else{
      return a.len() > b.len();
    }
  }else if(as == -1 && bs == -1){
    if(a.len() == b.len()){
      int i=a.len();
      while(--i != 0){
        if(a[i] != b[i]){
          return a[i] < b[i];
        }
      }
      return false;
    }else{
      return a.len() < b.len();
    }
  }else{
    return as == 1;
  }
}
bool operator < (const BigInteger &a,const BigInteger &b){
  return b > a;
}
bool operator == (const BigInteger &a,const BigInteger &b){
  char as = a.sig();
  char bs = b.sig();
  if(as != bs) return false;

  if(a.len() != b.len()){
    return false;
  }else{
    for(int i=0;i<a.len();i++){
      if(a[i]!=b[i]) return false;
    }
  }
  return true;
}

bool operator != (const BigInteger &a,const BigInteger &b){
  return !(a==b);
}

/* operator */
BigInteger operator - (const BigInteger &a){
  return BigInteger(a.vec(),-a.sig());
}

BigInteger operator + (const BigInteger &a,const BigInteger &b){
  int lena = a.size();
  int lenb = b.size();
  int maxlen = std::max(lena,lenb);
  std::vector<char> v = std::vector<char>(maxlen+1,0);
  int sig = 1;

  for(int i=0;i<maxlen;i++){
    v[i] += a.sig()*a[i]+b.sig()*b[i];
    while(v[i] < 0){
      v[i+1]--;
      v[i]+=10;
      std::cout << "test" << std::endl;
    }
    if(v[i] >=10){
      v[i+1] = v[i]/10;
      v[i]%=10;
    }
  }

  if(v[maxlen]<0){
    sig = -1;
    for(int i=0;i<maxlen;i++){
      v[i]=-v[i];
      while(v[i]<0){
        v[i+1]++;
        v[i]+=10;
      }
    }
    v[maxlen]=-v[maxlen];
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);
  
  return BigInteger(v,sig);
}

BigInteger operator + (const BigInteger &a,int b){
  return a+BigInteger(b);
}


BigInteger &operator += (BigInteger &a,const BigInteger &b){
  a = a+b;
  return a;
}
BigInteger &operator += (BigInteger &a,int b){
  a = a+b;
  return a;
}

BigInteger &operator ++ (BigInteger &a){
  a = a + BigInteger(1);
  return a;
}

BigInteger operator - (const BigInteger &a,const BigInteger &b){
  return a + (- b); 
}

BigInteger operator * (const BigInteger &a,const BigInteger &b){
  int len = a.size() + b.size() + 2;
  int sign = a.sig()*b.sig();

  std::vector<char> v(len);

  for(int i=0;i<a.size();i++){
    if(a[i] == 0) continue;
    for(int j=0;j<b.size();j++){
      v[i+j] += a[i]*b[j];
      if(v[i+j] >=10){
        v[i+j+1] = v[i+j]/10;
        v[i+j]%=10;
      }
    }
  }

  int pos=v.size();
  while(pos!=1 && v[pos-1]==0) pos--;
  if(pos != v.size()) v.resize(pos);

  return BigInteger(v,sign);
}

BigInteger operator * (const BigInteger &a,int b){
  return a*BigInteger(b);
}

BigInteger &operator *= (BigInteger &a,const BigInteger &b){
  a = a*b;
  return a;
}
BigInteger &operator *= (BigInteger &a,int b){
  a = a*b;
  return a;
}

BigInteger reverse(const BigInteger &a){
  BigInteger b=a;
  std::reverse(b.nums.begin(),b.nums.end());
  return b;
}

BigInteger power(BigInteger a,int b){
  if(b == 0) return BigInteger(1);
  if((b&1) != 0){
    return a*power(a*a,b>>1);
  }else{
    return power(a*a,b>>1);
  }
}

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

C++: #include<iostream>
int main(){
	int n;
	std::cin>>n;
	int a=1;
	if(n<=12){
		for(int i=1;i<=n;i++){
			a*=i;
		}
		std::cout<<a<<std::endl;
	}
	else if(n==13)std::cout<<355687428096000/16/15/14/13;
	else if(n==14)std::cout<<355687428096000/16/15/14;
	else if(n==15)std::cout<<355687428096000/16/15;
	else if(n==16)std::cout<<355687428096000/16;
	else if(n==17)std::cout<<355687428096000;
	else if(n==18)std::cout<<355687428096000*18;
	else if(n==19)std::cout<<355687428096000*18*19;
	else if(n==20)std::cout<<355687428096000*18*19*20;
	

	return 0;
}

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

int main(){
  int i,j,k;
  int n1=0,n2=1;

  cin>>n1;

  for(i=1;i<=n1;i++){
    n2*=i;
  }
  cout<<n2<<endl;

  return 0;
}

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

typedef long long Int;

int main(){
	int n;
	Int res;
	
	scanf("%d", &n);
	
	res = 1;
	while(n > 1){
		res *= n;
		n--;
	}
	
	printf("%lld\n", res);
	
	return 0;
}

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

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

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

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

long long fact(int n);

int main()
{
	int n;

	scanf("%d", &n);

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

	return (0);
}

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

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

int main()
{
	
	int num, total=1;
	
	cout << "Please enter a number : ";
	cin >> num;
	
	int temp = num;
	int score[num];

	for(int i=0; i<temp; i++)
	{
		score[i]=num;
		--num;
	}
	
	for(int i=0; i<temp; i++)
	{
		total*=score[i];
	}
	
	cout << "Answer : " << total;
	return 0;
}