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++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 81
#define _MAX 100
#define ABC 26
int main(void)
{
	int n;
	long long int ans;
	scanf_s("%d", &n);
	for (int i = 1; i <= n; ++i) {
		ans *= i;
	}
	printf("%lld\n", ans);
}

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

#define SAFE_DELETE( x ) { if ( x ){ delete x ; x = NULL; } }

struct tCell{
	char x;
	tCell* prev;
	tCell* next;
};

class myInt{
public:
	myInt( int d = 0 ) : digit( 0 ), head( NULL ), tail( NULL ){
		head = new tCell;
		tail = new tCell;
		head->x = tail->x = 0;
		head->prev = tail->next = NULL;
		head->next = tail;
		tail->prev = head;
		setFigure( d );
	}
	~myInt(){
		init();
		SAFE_DELETE( tail );
		SAFE_DELETE( head );
	}
	void getNumber( string& s ){
		s = numStr;
		for( unsigned int i = 0; i < numStr.size(); ++i ){
			s[ i ] += '0';
		}
	}
	int getDigit(){
		return digit;
	}

	tCell operator[]( int d ){
		if ( d >= digit ){
			tCell* cell = NULL;
			return *cell;
		}
		tCell* cell = head->next;
		for ( int i = 0; i < d; ++i ){
			cell = cell->next;
		}
		return *cell;
	}
	void operator=( int d ){
		setFigure( d );
	}
	void operator=( myInt& mi ){
		init();
		for ( int i = 0; i < mi.getDigit(); ++i ){
			pushBack( mi[ i ].x );
		}
	}
	void operator+=( myInt& mi ){
		int max = ( digit < mi.getDigit() ? mi.getDigit() : digit ) + 1;
		secureDigit( max );
		mi.secureDigit( max );
		tCell* cell = head;
		for ( int i = 0; i < max-1; ++i ){
			cell = cell->next;
			cell->x += mi[ i ].x;
			if ( cell->x >= 10 ){
				cell->x %= 10;
				cell->next->x += 1;
			}
		}
		adjustDigit();
		rewrite();
		mi.adjustDigit();
	}
	void operator*=( int d ){
		myInt ee, result;
		ee = *this;
		int eeDigit = ee.getDigit();
		int dDigit = static_cast< int >( log10( static_cast< double >( d ) ) ) + 1;
		for ( int i = 0; i < dDigit; ++i ){
			init();
			secureDigit( eeDigit + 1 );
			tCell* cell = head;
			for ( int j = 0; j < eeDigit; ++j ){
				cell = cell->next;
				cell->x += ee[ j ].x * static_cast< char >( d % 10 );
				cell->next->x += ( cell->x / 10 );
				cell->x = ( cell->x % 10 );
			}
			for ( int j = 0; j < i; ++j ){
				pushFront( 0 );
			}
			result += *this;
			d /= 10;
		}
		*this = result;
	}

private:
	void init(){
		for ( int i = digit; i > 0; --i ){
			tCell* cell = tail->prev;
			cell->prev->next = cell->next;
			cell->next->prev = cell->prev;
			SAFE_DELETE( cell );
		}
		digit = 0;
		numStr = "";
	}
	void setFigure( int d ){
		init();
		while ( 1 ){
			if ( d < 10 ){
				pushBack( d );
				break;
			}
			pushBack( d%10 );
			d /= 10;
		}
	}
	void pushFront( int i ){
		++digit;
		tCell* cell = new tCell;
		cell->x = i;
		cell->prev = head;
		cell->next = head->next;
		cell->prev->next = cell;
		cell->next->prev = cell;
		numStr += static_cast< char >( i );
	}
	void pushBack( int i ){
		++digit;
		tCell* cell = new tCell;
		cell->x = i;
		cell->prev = tail->prev;
		cell->next = tail;
		cell->prev->next = cell;
		cell->next->prev = cell;
		numStr = static_cast< char >( i ) + numStr;
	}
	tCell* eraseBack( tCell* cell ){
		tCell* temp = cell->prev;
		--digit;
		numStr.erase( 0, 1 );
		cell->prev->next = cell->next;
		cell->next->prev = cell->prev;
		SAFE_DELETE( cell );
		return temp;
	}
	void secureDigit( int d ){
		for ( int i = digit; i < d; ++i ){
			pushBack( 0 );
		}
	}
	void adjustDigit(){
		tCell* cell = tail->prev;
		while ( !cell->x ) {
			if ( digit <= 1 ) return;
			cell = eraseBack( cell );
		}
	}
	void rewrite(){
		numStr = "";
		tCell* cell = head;
		for ( int i = 0; i < digit; ++i ){
			cell = cell->next;
			numStr = static_cast< char >( cell->x ) + numStr;
		}
	}

	int digit;
	tCell* head;
	tCell* tail;
	string numStr;
};

ostream& operator<<( ostream& os, myInt& mi ){
	string s;
	mi.getNumber( s );
	return ( os << s.c_str() );
}

int main(){
	int n;
	myInt a( 1 );
	cin >> n;

	for ( int i = 0; i < n; i++ ){
		a *= ( i + 1 );
	}

	cout << a << endl;

	return 0;
}

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 <iostream>
using namespace std;
int main(){
    int n;
	cin >> n;
    int x = 1;
    for(int i=0; i<n; ++i){
		x = x*(i+1);
    }
    cout << x;
	return 0;
}

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

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

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

	cout << factorial(n) << endl;

	return 0;
}

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

int main(){
  int n;
  while(cin >> n){
  for(int i=n-1;0<i;i--)
    n *= i;
  cout << n << 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;
    if(n<=20){
    long long  rslt = fctrl(n);

    cout<<rslt<<endl;
    }
    return 0;
}

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

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

C++: #include <cstdio>
#include <algorithm>
#include <functional>
#include <stack>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define llong long long

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

int main() {
  int n;
  scanf("%d",&n);
  printf("%lld\n",factorial(n));
  return 0;
}

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<stdio.h>

using namespace std;


long long int factriolf(long long int n)
{
    long long int f,i;
    f = 1;
    for (i = 1; i<=n;i++)
    {
      f = f *i;
    }
    return f;
}

int main ()
{
    long long int n;
    scanf("%lld",&n);

long long int r = factriolf(n);

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

return 0;
}

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

int main() {
	long long int n,ans = 1;
	cin >> n;
	if (n <= 20 && n >= 1) {
		for (int a = 1; a <= n; a++) {
			ans = ans*a;
		}
		cout << ans << endl;
	}
}

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

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

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,P> pip;
typedef long long ll;
const int inf=(1<<31)-1;
const double pi=acos(-1);

int n;
ll ans=1;

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

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