criyle/codenet-compile-errors huggingface dataset:
Language: 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);

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

}


    cout << b << endl;



    //cout << endl;

return 0;

}

Compiler output:
a.cc:17:6: error: stray '#' in program
   17 |     }#include <iostream>
      |      ^
a.cc: In function 'int main()':
a.cc:17:7: error: 'include' was not declared in this scope
   17 |     }#include <iostream>
      |       ^~~~~~~
a.cc:17:24: error: expected primary-expression before '>' token
   17 |     }#include <iostream>
      |                        ^
a.cc:23:1: error: expected primary-expression before 'using'
   23 | using namespace std;
      | ^~~~~
a.cc:25:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   25 | int main()
      |         ^~
a.cc:25:9: note: remove parentheses to default-initialize a variable
   25 | int main()
      |         ^~
      |         --
a.cc:25:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:26:1: error: a function-definition is not allowed here before '{' token
   26 | {
      | ^
Language: C++

#include<cstdio>
using namespace std;

int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};

int main(){
  int a;
  scanf("%d", &a);
  printf("%d\n", ans[a - 1]);
  return 0;
}

Compiler output:
a.cc:4:98: error: expected '}' before numeric constant
    4 | int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |           ~                                                                                      ^~~~~~~~~~~
a.cc:4:5: error: scalar object 'ans' requires one element in initializer
    4 | int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |     ^~~
a.cc:4:98: error: expected ',' or ';' before numeric constant
    4 | int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |                                                                                                  ^~~~~~~~~~~
a.cc:4:216: error: expected declaration before '}' token
    4 | int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |                                                                                                                                                                                                                        ^
Language: C++

#include<cstdio>
using namespace std;

int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};

int main(){
  int a;
  scanf("%d", &a);
  printf("%d\n", ans[a - 1]);
  return 0;
}

Compiler output:
a.cc:4:100: error: expected '}' before numeric constant
    4 | int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |             ~                                                                                      ^~~~~~~~~~~
a.cc:4:88: error: narrowing conversion of '6.2270208e+9' from 'double' to 'int' [-Wnarrowing]
    4 | int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |                                                                                        ^~~~~~~~~~~
a.cc:4:218: error: expected declaration before '}' token
    4 | int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000};
      |                                                                                                                                                                                                                          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |    for(i=1;i<=n;i++)
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'out' was not declared in this scope
    7 |   out << tgamma(a+1) << endl;
      |   ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: 'n' was not declared in this scope
    7 |   cout << (long long)tgamma((long int)n + 1) << endl;
      |                                       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	unsigned __int64 a=1;
	int i,n;
	cin>>n;
	for(i=n;i>0;i--){
		a*=i;
	}
	cout<<a<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:26: error: expected initializer before 'a'
    4 |         unsigned __int64 a=1;
      |                          ^
a.cc:8:17: error: 'a' was not declared in this scope
    8 |                 a*=i;
      |                 ^
a.cc:10:15: error: 'a' was not declared in this scope
   10 |         cout<<a<<endl;
      |               ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 |         ans *= i
      |                 ^
      |                 ;
   10 |     }
      |     ~            
a.cc:11:13: error: 'i' was not declared in this scope
   11 |     cout << i << endl;
      |             ^
Language: C++

#include <bits/stdc++.h>

int fact(int x) {
if(x == 1) return 1;
else return x * fact(x-1);
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | int n; cin >> n;
      |        ^~~
      |        std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout << fact(n) << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 | cout << fact(n) << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: 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\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<stdio.h>
int ke(int x)
{
    if(x == 1)return 1;
    else return x*ke(x-1);
}
int main()
{
    int a;
    cin >> a;
    printf("%d",ke(a));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> a;
      |     ^~~
Language: C++

#include <iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '<' token
   14 |   cout <<< f << endl;
      |          ^
a.cc:14:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |   cout <<< f << endl;
      |            ~~^~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
	int n;
	unsigned long long int re = 1;
	
	cin >> n;
	while(n >= 2) {
		re *= n;
		n--;
	}
	
	cout << re << endl;
	
	return 0;
	
}#include <iostream>

using namespace std;

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

Compiler output:
a.cc:19:2: error: stray '#' in program
   19 | }#include <iostream>
      |  ^
a.cc:19:3: error: 'include' does not name a type
   19 | }#include <iostream>
      |   ^~~~~~~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     int a; cin >> a;
      |            ^~~
      |            std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout << fact[a] << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     cout << fact[a] << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

 
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
  
 int main()
 {
   long long int n;
   long long result=1;
   cin>>n
   while(n--)
   {
     result*=n;    
   }
   cout<<result<<endl;
   //while(1);      
   return 0;    
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected ';' before 'while'
   22 |    cin>>n
      |          ^
      |          ;
   23 |    while(n--)
      |    ~~~~~
Language: 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 
 



 

Compiler output:
a.cc:28:6: error: stray '#' in program
   28 | Case # Verdict CPU Time Memory In Out Case Name
      |      ^
a.cc:29:7: error: stray '#' in program
   29 |  Case #1: : Accepted  00.00 sec 3056 KB
      |       ^
a.cc:37:13: error: stray '#' in program
   37 | Judge Input #1 (  | )  Judge Output #1 (  | )
      |             ^
a.cc:37:37: error: stray '#' in program
   37 | Judge Input #1 (  | )  Judge Output #1 (  | )
      |                                     ^
a.cc:20:1: error: 'Compile' does not name a type
   20 | Compile Error Logs:
      | ^~~~~~~
Language: C++

#include <cstdio>
using namespace std;
long long fact(int n){
  if(n==2) return 2;
  return fact(n-1)*n;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> n;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout << fact(n) << endl;
      |   ^~~~
a.cc:11:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |   cout << fact(n) << endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
int main(){
    ll n,ans=1;
    cin >> n;
    while(n--){
        ans*=n;
    }
    cout << n << endl
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before 'return'
   12 |     cout << n << endl
      |                      ^
      |                      ;
   13 |     return 0;
      |     ~~~~~~
Language: C++

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'doublr' was not declared in this scope; did you mean 'double'?
    6 |   doublr ans=1;
      |   ^~~~~~
      |   double
a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     ans*=i;
      |     ^~~
      |     abs
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <stdio.h>
int main(void){
   int n,i,P;
   P=1;
   n<=1&&n<=20
   scanf("%d",&n);
   for(i=1;i<=n;i++){
       P=P*i;
   }
   printf("%d\n",P);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: expected ';' before 'scanf'
    5 |    n<=1&&n<=20
      |               ^
      |               ;
    6 |    scanf("%d",&n);
      |    ~~~~~
Language: C++

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

Compiler output:
a.cc:2:1: error: 'n' does not name a type
    2 | n,i;
      | ^
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:13: error: 'n' was not declared in this scope
    4 |   std::cin>>n;
      |             ^
a.cc:5:7: error: 'i' was not declared in this scope
    5 |   for(i=n;--n;)
      |       ^
a.cc:7:14: error: 'i' was not declared in this scope
    7 |   std::cout<<i;}
      |              ^
Language: C++

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

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){long long n,i;for(std::cin>>n,i=n;i>1;n*=--i);std::cout<<n<<endl;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:68: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    2 | main(){long long n,i;for(std::cin>>n,i=n;i>1;n*=--i);std::cout<<n<<endl;}
      |                                                                    ^~~~
      |                                                                    std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    8 |         __int64 ans=1;
      |         ^~~~~~~
      |         __int64_t
a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |                 ans*=i;
      |                 ^~~
      |                 abs
a.cc:17:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

import java.util.Scanner;

class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		
		System.out.println(fact(sc.nextInt()));
	}
	private static long fact(long n)
	{
		if (n == 1) return 1;
		return fact(n - 1) * n;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String args[])
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String args[])
      |                                 ^~~~~~
a.cc:11:16: error: expected ':' before 'static'
   11 |         private static long fact(long n)
      |                ^~~~~~~
      |                :
a.cc:16:2: error: expected ';' after class definition
   16 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
    7 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:9:17: error: 'System' was not declared in this scope
    9 |                 System.out.println(fact(sc.nextInt()));
      |                 ^~~~~~
a.cc:9:41: error: 'sc' was not declared in this scope
    9 |                 System.out.println(fact(sc.nextInt()));
      |                                         ^~
Language: C++

nclude<iostream>
using namespace std;
int function(int n){
  if(n > 1)
    return n * function(n-1);
  else
    return 1;
}

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

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> n;
      |   ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << function(n) << endl;
      |   ^~~~
a.cc:13:26: error: 'endl' was not declared in this scope
   13 |   cout << function(n) << endl;
      |                          ^~~~
Language: C++

nclude<iostream>
using namespace std;
int function(int n){
  if(n > 1)
    return n * function(n-1);
  else
    return 1;
}

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

}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> n;
      |   ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << function(n) << endl;
      |   ^~~~
a.cc:13:26: error: 'endl' was not declared in this scope
   13 |   cout << function(n) << endl;
      |                          ^~~~
Language: C++

nclude<iostream>
using namespace std;
int function(int n){
  if(n > 1)
    return n * function(n-1);
  else
    return 1;
}

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

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> n;
      |   ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << function(n) << endl;
      |   ^~~~
a.cc:13:26: error: 'endl' was not declared in this scope
   13 |   cout << function(n) << endl;
      |                          ^~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(){
int cnt ,i,kaeru;
double num;
char total[10];
gets(total);
kaeru= atoi(total);
num = 1;
for( i = kaeru ; i >= 1 ; i-- ){
num *= i;
}
printf("%f",num);

 return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 | gets(total);
      | ^~~~
      | getw
Language: C++

n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);}

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);}
      | ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);}
      |       ^
Language: C++

c;main(){c=!puts("2432902008176640000");}

Compiler output:
a.cc:1:1: error: 'c' does not name a type
    1 | c;main(){c=!puts("2432902008176640000");}
      | ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | c;main(){c=!puts("2432902008176640000");}
      |   ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'c' was not declared in this scope
    1 | c;main(){c=!puts("2432902008176640000");}
      |          ^
a.cc:1:13: error: 'puts' was not declared in this scope
    1 | c;main(){c=!puts("2432902008176640000");}
      |             ^~~~
Language: C++

void main(){printf("%d\n",120);}

Compiler output:
a.cc:1:1: error: '::main' must return 'int'
    1 | void main(){printf("%d\n",120);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:13: error: 'printf' was not declared in this scope
    1 | void main(){printf("%d\n",120);}
      |             ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void main(){printf("%d\n",120);}
Language: C++

main(){printf("%d\n",120);return 0;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){printf("%d\n",120);return 0;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
    1 | main(){printf("%d\n",120);return 0;}
      |        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){printf("%d\n",120);return 0;}
Language: C++

#include <iostream>
using namespace std;

__int64 fact(int num);
int input_int();

int main()
{
	cout << fact(input_int()) << endl;
	return (0);
}

__int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); }

int input_int(void)
{
	int in;
	cin >> in;
	return (in);
}

Compiler output:
a.cc:4:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    4 | __int64 fact(int num);
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:9:17: error: 'fact' was not declared in this scope
    9 |         cout << fact(input_int()) << endl;
      |                 ^~~~
a.cc: At global scope:
a.cc:13:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   13 | __int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); }
      | ^~~~~~~
      | __int64_t
Language: C++

#include <iostream>
using namespace std;

__int64 fact(int num);
int input_int();

int main()
{
	cout << fact(input_int()) << endl;
	return (0);
}

__int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); }

int input_int()
{
	int in;
	cin >> in;
	return (in);
}

Compiler output:
a.cc:4:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    4 | __int64 fact(int num);
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:9:17: error: 'fact' was not declared in this scope
    9 |         cout << fact(input_int()) << endl;
      |                 ^~~~
a.cc: At global scope:
a.cc:13:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   13 | __int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); }
      | ^~~~~~~
      | __int64_t
Language: C++

main(){puts("2432902008176640000");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){puts("2432902008176640000");}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'puts' was not declared in this scope
    1 | main(){puts("2432902008176640000");}
      |        ^~~~
Language: C++

nclude<iostream>
using namespace std;

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

  while(cin >> n){

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

  }
 
    cout << ans << endl;
  }

}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |   while(cin >> n){
      |         ^~~
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << ans << endl;
      |     ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |     cout << ans << endl;
      |                    ^~~~
Language: C++

nclude<iostream>
using namespace std;

int main(){
  int n,i;
long long asn;

  while(cin >> n){

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

  }
 
    cout << ans << endl;
  }

}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |   while(cin >> n){
      |         ^~~
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'asn'?
   10 |   ans=1;
      |   ^~~
      |   asn
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << ans << endl;
      |     ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,i;
long long asn;

  while(cin >> n){

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

  }
 
    cout << ans << endl;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'asn'?
   10 |   ans=1;
      |   ^~~
      |   asn
Language: C++

#include <iostream>
using namespace std;

int main(void)
{
 int a,b;
 cin >> a;
 for(i=a;i>0;i--)
 {
   b*=i;
 }
  cout << b;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'i' was not declared in this scope
    8 |  for(i=a;i>0;i--)
      |      ^
Language: C++

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << s <<endl;
      |   ^~~~
a.cc:8:15: error: 'endl' was not declared in this scope
    8 |   cout << s <<endl;
      |               ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'sout' was not declared in this scope
    9 |   sout <<sum<<endl;
      |   ^~~~
Language: C++

#include<iostream>	
 
int main()	
{
	using namespace std;	
 
	int num,factorial=1;
	cout<<"Enter the number: ";  
	cin>>num;
 
	for(int i=1;i<=num;i++)
	{
		factorial=factorial*i;
	}
 
	cout<<<<factorial<<endl;
 
	cin.get();
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected primary-expression before '<<' token
   16 |         cout<<<<factorial<<endl;
      |               ^~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 | for(int i=1;i<=num;i++)
      |                ^~~
      |                enum
Language: C++

#include<iostream>

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

int main()
{
	int x;
	std::cin >> x;
	std::cout << fact( x ) << std::endl;

 	return 0;
}

Compiler output:
a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    3 | __int64 fact( int n )
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:13:22: error: 'fact' was not declared in this scope
   13 |         std::cout << fact( x ) << std::endl;
      |                      ^~~~
Language: C++

#include<iostream>
using namespace std;
int n,a,ans;
int !(int x){
if(x<1){return 1;}
if(x>=1){
a=!(x-1)*x;
return a;}}

int solve(){
cin>>n;
ans=!(n);
cout<<ans<<endl;}

Compiler output:
a.cc:4:5: error: expected unqualified-id before '!' token
    4 | int !(int x){
      |     ^
a.cc: In function 'int solve()':
a.cc:13:17: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | cout<<ans<<endl;}
      |                 ^
Language: C++

#include<iostream>
using namespase std;
int main(){
int n;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | while(cin>>n){
      |       ^~~
      |       std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << pro << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 | cout << pro << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>
int fact(int n){
    if(n>1)
    return n*fact(n-1);
    return 1;
}
main(){
int x;
    scanf("%d",&x)
    printf("%d\n",fact(x));
}

Compiler output:
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before 'printf'
    9 |     scanf("%d",&x)
      |                   ^
      |                   ;
   10 |     printf("%d\n",fact(x));
      |     ~~~~~~
Language: C++

#include<stdio.h>int fact(int n){    if(n>1)    return n*fact(n-1);    return 1;}main(){int x;    scanf("%d",&x);    printf("%d\n",fact(x));}

Compiler output:
a.cc:1:22: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>int fact(int n){    if(n>1)    return n*fact(n-1);    return 1;}main(){int x;    scanf("%d",&x);    printf("%d\n",fact(x));}
      |                      ^~~~
a.cc:1:9: fatal error: stdio.h>in: No such file or directory
    1 | #include<stdio.h>int fact(int n){    if(n>1)    return n*fact(n-1);    return 1;}main(){int x;    scanf("%d",&x);    printf("%d\n",fact(x));}
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

void main(a,i){
long long n=scanf("%d",&a);
for(i=0;i++<a;)n*=i;
printf("%llu\n",n);
}

Compiler output:
a.cc:1:6: error: variable or field 'main' declared void
    1 | void main(a,i){
      |      ^~~~
a.cc:1:11: error: 'a' was not declared in this scope
    1 | void main(a,i){
      |           ^
a.cc:1:13: error: 'i' was not declared in this scope
    1 | void main(a,i){
      |             ^
Language: C++

int main(a,i){
long long n=scanf("%d",&a);
for(i=0;i++<a;)n*=i;
printf("%llu\n",n);
return 0;
}

Compiler output:
a.cc:1:5: error: cannot declare '::main' to be a global variable
    1 | int main(a,i){
      |     ^~~~
a.cc:1:10: error: 'a' was not declared in this scope
    1 | int main(a,i){
      |          ^
a.cc:1:12: error: 'i' was not declared in this scope
    1 | int main(a,i){
      |            ^
a.cc:1:13: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | int main(a,i){
      |             ^
Language: C++

#include<iostream>
using namespace std;

long long ans=1;

long long factorial(int n){   // 再起関数
  if(n==1){
    return ans;
  }else{
    ans = n*factorial(n-1);
  }
}

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

  if(n<0){
    cout << "計算できません。" << endl;
  }else if(n==0 || n==1){
    cout << 1 << endl;
  }else{
    cout << factorial(n) << endl; // 再起

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:14:11: note: to match this '{'
   14 | int main(){
      |           ^
a.cc: In function 'long long int factorial(int)':
a.cc:10:9: warning: control reaches end of non-void function [-Wreturn-type]
   10 |     ans = n*factorial(n-1);
      |     ~~~~^~~~~~~~~~~~~~~~~~
Language: 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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected '}' before 'else'
   19 |   else{
      |   ^~~~
a.cc:16:20: note: to match this '{'
   16 |   if(n>=1 && n<=20){
      |                    ^
Language: C++

main(){puts("2432902008176640000");return 0;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){puts("2432902008176640000");return 0;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'puts' was not declared in this scope
    1 | main(){puts("2432902008176640000");return 0;}
      |        ^~~~
Language: C++

main(){printf("2432902008176640000\n");return;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){printf("2432902008176640000\n");return;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
    1 | main(){printf("2432902008176640000\n");return;}
      |        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){printf("2432902008176640000\n");return;}
a.cc:1:40: error: return-statement with no value, in function returning 'int' [-fpermissive]
    1 | main(){printf("2432902008176640000\n");return;}
      |                                        ^~~~~~
Language: C++

main(){printf("2432902008176640000\n");return 0;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){printf("2432902008176640000\n");return 0;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
    1 | main(){printf("2432902008176640000\n");return 0;}
      |        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){printf("2432902008176640000\n");return 0;}
Language: C++

main()printf("2432902008176640000\n");return 0;

Compiler output:
a.cc:1:7: error: expected constructor, destructor, or type conversion before 'printf'
    1 | main()printf("2432902008176640000\n");return 0;
      |       ^~~~~~
a.cc:1:39: error: expected unqualified-id before 'return'
    1 | main()printf("2432902008176640000\n");return 0;
      |                                       ^~~~~~
Language: C++

main(){printf("2432902008176640000\n");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){printf("2432902008176640000\n");}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
    1 | main(){printf("2432902008176640000\n");}
      |        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){printf("2432902008176640000\n");}
Language: C++

#include <stdio.h>

typedef long long LL;

LL a[21];

void init(){
	a[1] = 1;
	for (int i=2; i<=20; ++i){
		a[i] = a[i-1]*i;
	}
}

void solve(LL n){
	printf("%lld\n", a[n]);
}

int main (){
	__int64 n;
	init();
	while (~scanf("%lld", &n)){
		solve(n);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   19 |         __int64 n;
      |         ^~~~~~~
      |         __int64_t
a.cc:21:32: error: 'n' was not declared in this scope
   21 |         while (~scanf("%lld", &n)){
      |                                ^
Language: C++

#include <iostream>
using namespace std;
factorial(int n){
  return (--n) ? factorial(n):1;
}

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

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'factorial' with no type [-fpermissive]
    3 | factorial(int n){
      | ^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
factorial(int n){
  return ((--n) ? factorial(n):1);
}
int main(void){
  int n; cin >> n;
  cout << factorial(n) << endl;
  return 0;
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'factorial' with no type [-fpermissive]
    3 | factorial(int n){
      | ^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

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

int main(){
  int n;
  cin>>n;
  if(n<1||n<20)break;
  cout<< factorial(n)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: break statement not within loop or switch
   15 |   if(n<1||n<20)break;
      |                ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main() {
cin>>n; 
int ans = 1;
for(int i=1; i<=n; i++) ans *= i;
printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:6: error: 'n' was not declared in this scope
    4 | cin>>n;
      |      ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:6: error: 'n' was not declared in this scope
    4 | cin>>n;
      |      ^
Language: C++

#include <iostream>

using namespace std;

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

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

   return 0;
}

Compiler output:
a.cc:5:10: error: 'n' was not declared in this scope
    5 | int fact(n){
      |          ^
a.cc: In function 'int main()':
a.cc:13:17: error: 'fact' cannot be used as a function
   13 |     cout << fact(n) << endl;
      |             ~~~~^~~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
    9 | cout << i;
      |         ^
Language: C++

using namespace std;

int f(int x){
	if(x==0){
		return 1;
	}else{
		return x*f(x-1);
	}
}

int main(){
	long int a,r;
	while(cin >> a){
		r=f(a);
		cout << r << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'cin' was not declared in this scope
   13 |         while(cin >> a){
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |                 cout << r << endl;
      |                 ^~~~
a.cc:15:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:30: error: 'endl' was not declared in this scope
   15 |                 cout << r << endl;
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

p (1..gets.to_i).inject(:*)

Compiler output:
a.cc:1:4: error: too many decimal points in number
    1 | p (1..gets.to_i).inject(:*)
      |    ^~~~~~~~~~~~
a.cc:1:3: error: expected constructor, destructor, or type conversion before '(' token
    1 | p (1..gets.to_i).inject(:*)
      |   ^
Language: C++

#include<iostream>

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

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |  cout<<r<<endl;
      |  ^~~~
      |  std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:11: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |  cout<<r<<endl;
      |           ^~~~
      |           std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'r' was not declared in this scope
    6 | r;
      | ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

float factorial(float n);

int main()
{
    long long n;
    
    do
    {
    cout<< "Enter value : " ;
    cin >> n;
    
    }while(n>20);
    
    cout<< factorial(n) << endl;
    
    return 0;
}

float factorial(float n)
{
    int x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    return sum;
}

Compiler output:
a.cc:3:10: fatal error: windows.h: No such file or directory
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

float factorial(float n);

int main()
{
    float n;
    
    do
    {
    cout<< "Enter value : " ;
    cin >> n;
    
    }while(n>20);
    
    cout<< factorial(n) << endl;
    
    return 0;
}

float factorial(float n)
{
    int x;
    float sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    return sum;
}

Compiler output:
a.cc:3:10: fatal error: windows.h: No such file or directory
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

int main()
{
    long long n;
    
    do
    {
    cout<< "Enter value : " ;
    cin >> n;
    
    }while(n>20);
    
    int x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    
    cout<< sum << endl;
    
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: windows.h: No such file or directory
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

int main()
{
    long long n;
    
    do
    {
    cin >> n;
    
    }while(n>20);
    
    int x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    
    cout<< sum << endl;
    
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: windows.h: No such file or directory
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;

int main()
{
    long long n;
    
    do
    {
    cin >> n;
    
    }while(n>20);
    
    long long x;
    long long sum=1;
    for(x=1; x<=n; x++)
    {
       sum = sum*x;
    }
    
    cout<< sum << endl;
    
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: windows.h: No such file or directory
    3 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.