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 <stdio.h>
/*
2432902008176640000
121645100408832000
6402373705728000
355687428096000
20922789888000
  */
long long fact(long long n){ return n>0 ? fact(n-1)*n : 1LL; }
int main(){
  puts("2432902008176640000"); return 0;
}

C++: #include <cstdio>

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

C++: #include<iostream>
using namespace std;
int main()
{   
    int n,i;
    int fact=1;
    cin >> n;
    for(i=1;i<=n;i++)
    {
        fact=fact*i;
    }
    cout << "fact" << fact << 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 <bits/stdc++.h>
//#include <Windows.h>
using namespace std;
long long int fact(int n){
	if(n==0)return 1;
	else return n*fact(n-1);
}

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


return 0;
}

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

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

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, ans = 1;
	scanf_s("%d", &n);
	for (int i = 1; i <= n; ++i) {
		ans *= i;
	}
	printf("%d", ans);
}

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

int main(){
  int n,i,ans;

  cin >> n;

  ans=1;
  for(i=0;i<n;i++){
    ans=ans*(n-i);

  }
 
    cout << ans << endl;

}

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

int 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);
  return 0;
}

C++: #include <stdio.h>

int main()
{
	int n;
	double x;

	x = 1;

	scanf("%d", &n);

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

	printf("%f\n", x);

	return 0;
}

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

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

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

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

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

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

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

C++: #include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;


int main(){
	long long out;
	int n;
	while(cin >> n){
		out = 1;
		for(int i = 0; i <= n; i++){
			if(i){
				out *= i;
			}
		}

		cout << out << endl;
	}

	return 0;
}

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

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

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll temp(ll);

ll temp(ll i){
    if(i<=1)return 1;
    return i*temp(i-1);
}

int main(){
    ll x;
    cin>>x;
    cout<<temp(x)<<endl;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
  int a;
  while(cin >> a) {
    cout << tgamma(a+1) << endl;
  }
  return 0;
}

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

C++: main(){printf("2432902008176640000\n");}

C++: #include <iostream>
#include <stdio.h>
typedef long long int64;
using namespace std;

int main(){
    int64 num;
    int64 factorial=1;
    scanf("%lld", &num);
    for(;num > 0; num--){
        factorial *= num;
    }
    printf("%lld", factorial);
    return 0;
}

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

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

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

C++: #include <iostream>

using namespace std;

int main(void) {
	int n, ans = 1;

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

C++: #include <iostream>

using namespace std;

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

C++: 

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

 
Compile Error Logs: 

You are not authorized to see the message. 
 
 
Status 
Judge: 1/1  C++  CPU: 00.00 sec  Memory: 3056 KB  Length: 190 B  2017-03-15 15:43  2017-03-15 15:43  
Results for testcases 
Case # Verdict CPU Time Memory In Out Case Name 
 Case #1: : Accepted  00.00 sec 3056 KB    



 < prev | 1 /  1 | next >      : Accepted        00.00 sec        3056 KB 

 

Judge Input #1 (  | )  Judge Output #1 (  | ) 


  

 

Comments 
 

 Under Construction. 

 
Categories 
 



 
Free Tags

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

int main()
{
 int n;
 cin >> n;
 long long int ans;
 for(int i=1; i<=n; int i++) ans *= i;

 cout << ans << '\n';

 return 0;
}

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

unsigned long long 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>
//#include <fstream.h>
//#include <cstring>
using namespace std;

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

int main() {
  
  int n;

  cin >> n;

  cout << factorial(n);

  return 0;
}

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

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

int main(){
	int n;
	cin >> n;
	cout << fact(n,1) << endl;
	return 0;
}

C++: #include<cstdio>
using namespace std;
long long int fact(long long int x){
    if(x == 1) return 1;
    else return fact(x-1) * x;
}
int main(){
    int n;
    scanf("%d",&n);
    printf("%lld\n",fact(n));
    return 0;
}