criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
int a, b, c, d;
int main() {
    cin>>a>>b>>c>>d;
    cout<<max(a*b, c*d)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin>>a>>b>>c>>d;
      |     ^~~
      |     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:5:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |     cout<<max(a*b, c*d)<<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:5:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
    5 |     cout<<max(a*b, c*d)<<endl;
      |           ^~~
      |           std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:5:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |     cout<<max(a*b, c*d)<<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

#include<stdio.h>
int main(){
int A,B,C,D;
//scanfで文字列以外を指定する時は&が必要
scanf("%d %d %d %d",&A,&B,&C,&D);
f(A*B>=C*D){
printf("%d",A*B);
}
else{
printf("%d",C*D);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:1: error: implicit declaration of function 'f' [-Wimplicit-function-declaration]
    6 | f(A*B>=C*D){
      | ^
main.c:6:12: error: expected ';' before '{' token
    6 | f(A*B>=C*D){
      |            ^
      |            ;
Language: C

#include<stdio.h>
int main(){
int A,B,C,D,E,F;
//scanfで文字列以外を指定する時は&が必要
scanf("%d %d %d %d",&A,&B,&C,&D);
E = A*B;
F =C*D;
if(E>= F){
printf("%d",E);
}
else{
printf("%d",F);
}
return 0;

Compiler output:
main.c: In function 'main':
main.c:14:1: error: expected declaration or statement at end of input
   14 | return 0;
      | ^~~~~~
Language: Java

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		if (a * b < c * d) {
			System.out.println(c * d);
		} else {
			System.out.println(a * b);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>

using namespace std;

int mani(void){
	int a,b,c,d;
	cin >> a >> b >> c >> d;
	a*=b;
	c*=d;
	cout << (a>=c)?a:c << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int mani()':
a.cc:10:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |         cout << (a>=c)?a:c << endl;
      |                          ~~^~~~~~~
Language: C++

#include <iostream>

using namespace std;

void main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a*b > c*d)
		cout << a * b << endl;
	else
		cout << c * d << endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << max(a*b,c*d) << endl;
    return 0;
}#include<iostream>
using namespace std;
int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << max(a*b,c*d) << endl;
    return 0;
}

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

import java.util.Scanner;
class Main{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
long a=sc.nextInt();
long b=1;
for(int i=1;i<=a;i++){
b*=i;
}
a=b%(long)10000000000;
System.out.println(a);
}
}

Compiler output:
Main.java:10: error: integer number too large
a=b%(long)10000000000;
          ^
1 error
Language: C++

package main

import (
	"fmt"
)

func main() {
	var x, y, z, w int64
	fmt.Scan(&x, &y, &z, &w)
	ans := Max(x*y, z*w)
	fmt.Println(ans)
}

func Min(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func Max(x, y int64) int64 {
	if x > y {
		return x
	}
	return y
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:14:1: error: 'func' does not name a type
   14 | func Min(x, y int64) int64 {
      | ^~~~
a.cc:21:1: error: 'func' does not name a type
   21 | func Max(x, y int64) int64 {
      | ^~~~
Language: C

#include<stdlib.h>
int main(){
  int a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,& d);
  printf("%d\n", max(a*b, c*d) );
}


Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d%d%d%d",&a,&b,&c,& d);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<stdlib.h>
  +++ |+#include <stdio.h>
    2 | int main(){
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d%d%d%d",&a,&b,&c,& d);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |   printf("%d\n", max(a*b, c*d) );
      |   ^~~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:18: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
    5 |   printf("%d\n", max(a*b, c*d) );
      |                  ^~~
Language: C

#include<stdio.h>
int main(){
  int a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,& d);
  printf("%d\n", max(a*b, c*d) );
}


Compiler output:
main.c: In function 'main':
main.c:5:18: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
    5 |   printf("%d\n", max(a*b, c*d) );
      |                  ^~~
Language: C

#include<math.h>
int main(){
  int a,b,c,d;
  scanf("%d%d%d%d",&a,&b,&c,& d);
  printf("%d\n", max(a*b, c*d) );
}


Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d%d%d%d",&a,&b,&c,& d);
      |   ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include<math.h>
  +++ |+#include <stdio.h>
    2 | int main(){
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d%d%d%d",&a,&b,&c,& d);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |   printf("%d\n", max(a*b, c*d) );
      |   ^~~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:18: error: implicit declaration of function 'max'; did you mean 'fmax'? [-Wimplicit-function-declaration]
    5 |   printf("%d\n", max(a*b, c*d) );
      |                  ^~~
      |                  fmax
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

int N, M, res;
int G[100][100];
int c[100], m[100];

int dfs(int b, int n) {
	c[n] = 1;
	for (int i = 0; i < N; i++) {
		if (b == i || n == i) continue;
		if (G[n][i]) {
			if (c[i] == 1) return 0;
			if (!dfs(n, i)) return 0;
		}
	}
	return 1;
}

int isPrime(int x){
  int i;
  if(x < 2) return 0;
  else if(x == 2) return 1;
  if( x%2 == 0) return 0;
  for(i = 3; i*i <= x; i += 2){
    if(x%i == 0) return 0;
  }
  return 1;
}

const int pmax = 1000000;
bool isPrime_table[pmax];
//const is necessary;
void eratos(void){
  int i, j;
  double sqrtmax=sqrt(pmax);

  REP(k, pmax) isPrime_table[k] = true; /* Initialization */

  /* Sieve process  */
  isPrime_table[0] = false;
  isPrime_table[1] = false;
          /* 0 and 1 are not prime. */
  for (i=2; i <= sqrtmax; i++){
    if (isPrime_table[i]==true){   /* i is prime. */
      for (j=i; i*j<pmax; j++){
        isPrime_table[i*j] = false; /* multiples of i are not prime. */
      }
    }
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	cout <<< max(a*b, c*d) << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:98:16: error: expected primary-expression before '<' token
   98 |         cout <<< max(a*b, c*d) << endl;
      |                ^
a.cc:98:32: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
   98 |         cout <<< max(a*b, c*d) << endl;
      |                  ~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

int N, M, res;
int G[100][100];
int c[100], m[100];

int dfs(int b, int n) {
	c[n] = 1;
	for (int i = 0; i < N; i++) {
		if (b == i || n == i) continue;
		if (G[n][i]) {
			if (c[i] == 1) return 0;
			if (!dfs(n, i)) return 0;
		}
	}
	return 1;
}

int isPrime(int x){
  int i;
  if(x < 2) return 0;
  else if(x == 2) return 1;
  if( x%2 == 0) return 0;
  for(i = 3; i*i <= x; i += 2){
    if(x%i == 0) return 0;
  }
  return 1;
}

const int pmax = 1000000;
bool isPrime_table[pmax];
//const is necessary;
void eratos(void){
  int i, j;
  double sqrtmax=sqrt(pmax);

  REP(k, pmax) isPrime_table[k] = true; /* Initialization */

  /* Sieve process  */
  isPrime_table[0] = false;
  isPrime_table[1] = false;
          /* 0 and 1 are not prime. */
  for (i=2; i <= sqrtmax; i++){
    if (isPrime_table[i]==true){   /* i is prime. */
      for (j=i; i*j<pmax; j++){
        isPrime_table[i*j] = false; /* multiples of i are not prime. */
      }
    }
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	cout <<< max(a*B, c*d) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:16: error: expected primary-expression before '<' token
   98 |         cout <<< max(a*B, c*d) << endl;
      |                ^
a.cc:98:24: error: 'B' was not declared in this scope
   98 |         cout <<< max(a*B, c*d) << endl;
      |                        ^
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

int N, M, res;
int G[100][100];
int c[100], m[100];

int dfs(int b, int n) {
	c[n] = 1;
	for (int i = 0; i < N; i++) {
		if (b == i || n == i) continue;
		if (G[n][i]) {
			if (c[i] == 1) return 0;
			if (!dfs(n, i)) return 0;
		}
	}
	return 1;
}

int isPrime(int x){
  int i;
  if(x < 2) return 0;
  else if(x == 2) return 1;
  if( x%2 == 0) return 0;
  for(i = 3; i*i <= x; i += 2){
    if(x%i == 0) return 0;
  }
  return 1;
}

const int pmax = 1000000;
bool isPrime_table[pmax];
//const is necessary;
void eratos(void){
  int i, j;
  double sqrtmax=sqrt(pmax);

  REP(k, pmax) isPrime_table[k] = true; /* Initialization */

  /* Sieve process  */
  isPrime_table[0] = false;
  isPrime_table[1] = false;
          /* 0 and 1 are not prime. */
  for (i=2; i <= sqrtmax; i++){
    if (isPrime_table[i]==true){   /* i is prime. */
      for (j=i; i*j<pmax; j++){
        isPrime_table[i*j] = false; /* multiples of i are not prime. */
      }
    }
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	cout <<< max(a*B, c*d) << endl
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:16: error: expected primary-expression before '<' token
   98 |         cout <<< max(a*B, c*d) << endl
      |                ^
a.cc:98:24: error: 'B' was not declared in this scope
   98 |         cout <<< max(a*B, c*d) << endl
      |                        ^
Language: C++

#include<iostream>
#define Min min((x[loop] - x[loop - 1])*A, B)
#define max (int)pow(10,9)
using namespace std;

int min(int, int);

int main(){
	int N, A, B;
	int x[100000];
	int loop;
	long long int ans = 0;
	int ans2 = 0;

	cin >> N >> A >> B;
	for (loop = 0; loop < N; loop++)cin >> x[loop];

	for (loop = 1; loop < N; loop++){
		ans += Min%max;
		ans2 += Min / max;
	}
	if (ans2 != 0)cout << ans2;
	cout<< ans << "\n";
	return 0;
}

int min(int a, int b){
	if (a>b)return b;
	else return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: 'pow' was not declared in this scope
    3 | #define max (int)pow(10,9)
      |                  ^~~
a.cc:19:28: note: in expansion of macro 'max'
   19 |                 ans += Min%max;
      |                            ^~~
Language: C++

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

#define int long long

#define inf (int)1000000007

#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define trrep(i, n) for(int i = (n); i >= 0; i--)

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  cout << max(a * b, c * d) << endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>

using namespace std;

int mani(){
  int A, B, C, D;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> D;

  if(A * B >= C * D)
    cout << A*B;
  else if(A*B < C*D)
    cout << C*D;

  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<cardio>

int main()
{
  int A, B, C, D;
  scanf("%d %d %d %d", &A, &B, &C, &D);
  if (A * B > C * D)
    printf("%d¥n", A * B);
  else
    printf("%d¥n", C * D);
  return 0;
}


Compiler output:
a.cc:1:9: fatal error: cardio: No such file or directory
    1 | #include<cardio>
      |         ^~~~~~~~
compilation terminated.
Language: C++

a,b,c,d=gets.split.map &:to_i;p [a*b,c*d].max

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,c,d=gets.split.map &:to_i;p [a*b,c*d].max
      | ^
a.cc:1:31: error: 'p' does not name a type
    1 | a,b,c,d=gets.split.map &:to_i;p [a*b,c*d].max
      |                               ^
Language: C++

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

int main()
{
    unsigned long long a, b, c, d, ans, ans1;
    cin>>a>>b>>c>>d;
    ans =  a*b;
    ans1 =  c*d;
    if(ans>ans1)
        cout<<ans<<endl;;
    else
        cout<<ans1<<endl;;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'else' without a previous 'if'
   12 |     else
      |     ^~~~
Language: C

#include <stdio.h>
int main(){
int n;
char s[1000];
int s[100];
int i;
int x=1;
int o=0;
scanf("%d%s",&n,s);
for(i=0;i<n;i++){
	if(s[i]=='I'){
		printf("+1\n");
		++x;s[o]=x;
		o++;
	}else if(s[i]=='D'){
		--x;
		s[o]=x;
		o++;
		printf("-1\n");
	}
	
}
printf("%d",x);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: conflicting types for 's'; have 'int[100]'
    5 | int s[100];
      |     ^
main.c:4:6: note: previous declaration of 's' with type 'char[1000]'
    4 | char s[1000];
      |      ^
Language: C++

#include<stdio.h>
int main()
{
    int A,B,C,D,sum=1,sum2=1;
    scanf("%d%d%d%d",&A,&B,&C,&D);
    sum=A*B;
    sum2=C*D;
    if(sum>sum2)
    `   printf("%d",sum);
    else if(sum2>=sum)
        printf("%d",sum2);
}


Compiler output:
a.cc:9:5: error: stray '`' in program
    9 |     `   printf("%d",sum);
      |     ^
Language: C

#include<stdio.h>
int main()
{
    int A,B,C,D,sum=1,sum2=1;
    scanf("%d%d%d%d",&A,&B,&C,&D);
    sum=A*B;
    sum2=C*D;
    if(sum>sum2)
    `   printf("%d",sum);
    else if(sum2>sum)
        printf("%d",sum2);
    else
        printf("%d",sum);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:5: error: stray '`' in program
    9 |     `   printf("%d",sum);
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int a, b, c, d, e, f, g;
    cin >> a,b,c,d;
    e = a * b;
    f = c * d;
    if ( e => f )
    g = e;
    else g = f;
    cout << g << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before '>' token
    9 |     if ( e => f )
      |             ^
Language: C++

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

    int a,b,c,d;
    cin >> a,b,c,d;
    e = a * b;
    f = c * d;
    if (e => f )
    g = e;
    else g = f;
    cout << g;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'e' was not declared in this scope
    8 |     e = a * b;
      |     ^
a.cc:9:5: error: 'f' was not declared in this scope
    9 |     f = c * d;
      |     ^
a.cc:10:12: error: expected primary-expression before '>' token
   10 |     if (e => f )
      |            ^
a.cc:11:5: error: 'g' was not declared in this scope
   11 |     g = e;
      |     ^
a.cc:12:10: error: 'g' was not declared in this scope
   12 |     else g = f;
      |          ^
a.cc:13:13: error: 'g' was not declared in this scope
   13 |     cout << g;
      |             ^
Language: C++

#include<stdio.h>
int main() {
	int a, b, c, d;
	scanf_s("%d %d %d %d",&a, &b, &c, &d);
	if (a < 1 || a>10 * 10 * 10 * 10) {
		printf("Error");
	}
	if (b < 1 || b>10 * 10 * 10 * 10) {
		printf("Error");
	}
	if (c < 1 || c>10 * 10 * 10 * 10) {
		printf("Error");
	}
	if (d < 1 || d>10 * 10 * 10 * 10) {
		printf("Error");
	}
	int x1;
	int x2;
	x1 = a*b;
	x2 = c*d;
	if (x1 > x2) {
		printf("%d", x1);
	}
	if (x1 < x2) {
		printf("%d", x2);
	}
	if (x1 == x2) {
		printf("%d", x1);
	}



}


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



import java.util.Scanner;

//ABC052
public class TwoRectangles {

    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	long a = sc.nextLong(), b = sc.nextLong();
	long c = sc.nextLong(), d = sc.nextLong();
	System.out.println(Math.max(a * b, c * d));
    }

}


Compiler output:
Main.java:6: error: class TwoRectangles is public, should be declared in a file named TwoRectangles.java
public class TwoRectangles {
       ^
1 error
Language: C

#include <stdio.h>
int main(){

int a[len];
char k[len];
int i;
int y;
int temp;
int h;
int a;
int b;
int c;
int d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a*b>=c*d){
	printf("%d",a*b);
	
}
else if(a*b<=c*d){
	printf("%d",c*d);
	
}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:7: error: 'len' undeclared (first use in this function)
    4 | int a[len];
      |       ^~~
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan=new Scanner();
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
int d=scan.nextInt();
System.out.println(Math.max(a*b,c*d));
}
}


Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
Scanner scan=new Scanner();
             ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: C++

include <iostream>

using namespace std;
int main(){
	int a, b, c, d, e, f;
	cin << a << b << c << d;
	e = a*b;
	f = c*d;
	if(e >= f){
		cout << e << endl;
	}
	else{
		cout << f << endl;
	}
	return 0;
}



Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin << a << b << c << d;
      |         ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout << e << endl;
      |                 ^~~~
a.cc:10:30: error: 'endl' was not declared in this scope
   10 |                 cout << e << endl;
      |                              ^~~~
a.cc:13:17: error: 'cout' was not declared in this scope
   13 |                 cout << f << endl;
      |                 ^~~~
a.cc:13:30: error: 'endl' was not declared in this scope
   13 |                 cout << f << endl;
      |                              ^~~~
Language: C++

#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
using namespace std;
#define REP(i,n) for(int i=0;i < n; i++)
#define RREP(i,n) for(int i=n-1;i >=0; i--)
#define p(a) (a) * (a)
#define p2(a,b) p((a) - (b)) 

#define MAX 100002

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a*b == c*d) {
		cout << a*b << endl;
	}
	else if (a*b > c*d) {
		cout << a*b << endl;
	}
	else {
		cout << c*d << endl;
	}
	return 0;
}#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
using namespace std;
#define REP(i,n) for(int i=0;i < n; i++)
#define RREP(i,n) for(int i=n-1;i >=0; i--)
#define p(a) (a) * (a)
#define p2(a,b) p((a) - (b)) 

#define MAX 100002

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (a*b == c*d) {
		cout << a*b << endl;
	}
	else if (a*b > c*d) {
		cout << a*b << endl;
	}
	else {
		cout << c*d << endl;
	}
	return 0;
}

Compiler output:
a.cc:34:2: error: stray '#' in program
   34 | }#include<string>
      |  ^
a.cc:34:3: error: 'include' does not name a type
   34 | }#include<string>
      |   ^~~~~~~
a.cc:54:5: error: redefinition of 'int main()'
   54 | int main() {
      |     ^~~~
a.cc:21:5: note: 'int main()' previously defined here
   21 | int main() {
      |     ^~~~
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {

        Scanner sc  = new Scanner(System.in);

        int cnt = 0;
        String str = "";


        

        int N1 = Integer.parseInt(sc.next());
        int N2 = Integer.parseInt(sc.next());
        int W1 = Integer.parseInt(sc.next());
        int W2 = Integer.parseInt(sc.next());



        System.out.print(Math.max(N1N2,W1*W2));
        System.out.println();
    }

}

Compiler output:
Main.java:21: error: cannot find symbol
        System.out.print(Math.max(N1N2,W1*W2));
                                  ^
  symbol:   variable N1N2
  location: class Main
1 error
Language: C++

import java.util.*;
 
public class Main {
    public static void main(String[] args) {

        Scanner sc  = new Scanner(System.in);

        int cnt = 0;
        String str = "";


        

        int N1 = Integer.parseInt(sc.next());
        int N2 = Integer.parseInt(sc.next());
        int W1 = Integer.parseInt(sc.next());
        int W2 = Integer.parseInt(sc.next());



        System.out.print(Math.max(N1N2,W1*W2));
        System.out.println();
    }

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>

int main(){
 int n;
 cin >> n;
 string s;
 cin >> s;
  int ans = 0;
  int maxans = 0;
  for(int i = 0; i < n; i++){
    if(s[i] == 'I') ans ++;
    else ans--;
    maxans = max(ans,maxans);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |  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:6:2: error: 'string' was not declared in this scope
    6 |  string s;
      |  ^~~~~~
a.cc:6:2: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:9: error: 's' was not declared in this scope
    7 |  cin >> s;
      |         ^
a.cc:13:14: error: 'max' was not declared in this scope; did you mean 'std::max'?
   13 |     maxans = max(ans,maxans);
      |              ^~~
      |              std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: Java


import java.util.*;
public class Main4 {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		sc.nextLine();
		String st=sc.nextLine();
		int x=0;
		int ans=0;
		for(int i=0;i<n;i++)
		{
			if(st.charAt(i)=='I') x++;
			else x--;
			ans=Math.max(ans, x);
		}
		System.out.println(ans);
	}

}


Compiler output:
Main.java:3: error: class Main4 is public, should be declared in a file named Main4.java
public class Main4 {
       ^
1 error
Language: C++

#include <iostream>
#include <String>
using namespace std;
int main()
{
	int n,ans,sum;
	string s;
	cin>>n>>s;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='I')
		{
			ans++;
		}
		else if(s[i]=='D')
		{
			
			ans++;
		}
		sum=max(sum,ans);
	}
	cout<<sum;
	return 0;
}

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

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int x=0;
	string s
	cin>>s;
	int t[n];
	for(int j=0;j<n;j++){
		if(s[j]=='I'){
			x++;
			t[j]=x;
			continue;
		}
		x--;
		t[j]=x;
	}
	int m=t[0];
	for(int p=0;p<n;p++){
		for(int q=p+1;q<n;q++){
			if (t[q]>t[p]){
				m=t[q];
			}
				
		}
	}
	cout<<m;
	
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected initializer before 'cin'
    9 |         cin>>s;
      |         ^~~
a.cc:12:20: error: 's' was not declared in this scope
   12 |                 if(s[j]=='I'){
      |                    ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int x=0;
	int s[n],t[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	for(int j=0;j<n;j++){
		if(s[j]=='I'){
			x++;
			t[j]=x;
			continue;
		}
		x--;
		t[j]=x;
	}
	int m=t[0];
	for(int p=0;p<n;p++){
		for(int q=p+1;q<n;q++){
			if t[q]>t[p]{
				m=t[q];
			}
				
		}
	}
	cout<<m;
	
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: expected '(' before 't'
   24 |                         if t[q]>t[p]{
      |                            ^
      |                            (
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int x=0;
	int s[n],t[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	for(int j=0;j<n;j++){
		if(s[j]=='I'){
			x++;
			t[j]=x;
			continue;
		}
		x--;
		t[j]=x;
	}
	cout<<t.max();
	
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
   21 |         cout<<t.max();
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	cin>>n;
	int x=0;
	int s[n],t[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	for(int j=0;j<n;j++){
		if(s[j]=='I'){
			x++;
			t[j]==x;
			continue;
		}
		x--;
		t[j]==x;
	}
	cout<<t.max();
	
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
   21 |         cout<<t.max();
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n;
	int x=0;
	int s[n],t[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	for(int j=0;j<n;j++){
		if(s[j]=="i"){
			x++;
			t[j]==x;
			continue;
		}
		x--;
		t[j]==x;
	}
	cout<<t.max();
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                 if(s[j]=="i"){
      |                    ~~~~^~~~~
a.cc:20:17: error: request for member 'max' in 't', which is of non-class type 'int [n]'
   20 |         cout<<t.max();
      |                 ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int Q;
  cin >> Q;
  string str;
  int x = 0; 
  while(cin >> str){
  for(int i = 0; i < str.length(); i++){
    if(str[i] == 'I'){
      x += 1;
    }else{
      x -= 1;
    }
  }
  cout << x;
  }  
}
v

Compiler output:
a.cc:19:1: error: 'v' does not name a type
   19 | v
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int x=0, maxX=0;
    int N;
    string S;
    cin >> N >> S;
    for(int i=0; i<N; i++){
        if(S[i] == 'I'){
            x++;
        }else {
            x--;
        }
        maxX = x > maxX ? x : maxX;
    }
    cout << maxX << '\n'
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: expected ';' before '}' token
   17 |     cout << maxX << '\n'
      |                         ^
      |                         ;
   18 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(){
        int n,x=0,max=0;   cin>>n;
        string s;  cin>>s;
        rep(i, n){
                if(s[i]=='I')
                   x++;
                if(max<x)
                   max=x;
                else if(s[i]=='D')
                        x--;



        }
        cout<<max<<endl;
}
~        

Compiler output:
a.cc:22:2: error: expected class-name at end of input
   22 | ~
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N;
  cin>>N;
  string S;
  cin>>S;
  ll ans=0;
  ll max=0;
  for(ll i=0;i<N;i++) {
if(S[i]=='I') {
ans++;
}
if(S[i]=='D') {
ans--;
}
    max=max(ans,max);
  }
  
  cout<<max<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'max' cannot be used as a function
   20 |     max=max(ans,max);
      |         ~~~^~~~~~~~~
Language: C++


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

typedef long long ll;

int n;
string s;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'I')
            ++sum;
        else
            --sum;
        ans = max(ans, sum);
    }
    cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'sum' was not declared in this scope
   16 |             ++sum;
      |               ^~~
a.cc:18:15: error: 'sum' was not declared in this scope
   18 |             --sum;
      |               ^~~
a.cc:19:24: error: 'sum' was not declared in this scope
   19 |         ans = max(ans, sum);
      |                        ^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;

bool chmax(int& a, int b){
    if (a < b){
        a = b; return true;
    }
    else return false;
}

int main(){
    string s;
    cin >> s;
    int score=0, ans=0;
    for (int i=0; i<s.length(); i++){
        if (s[i] == 'I') score++;
        else if (s[i] == 'D') score--;
        chmax(ans, score);
    }
    cout << ans << ensl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)

int main() {
  int n;
  string s;
  cin >> n >> s;
  int x = 0,ans = 0;
  rep(i,0,s){
    if(s[i] == 'I') x++;
    else x--;
    ans = max(ans,x);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:39: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    5 | #define rep(i,s,n) for(int i = s; i < (int)(n); i++)
      |                                       ^~~~~~~~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,0,s){
      |   ^~~
Language: C++

/*
      author  : nishi5451
      created : 12.08.2020 22:15:41
*/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;


int main(){
    int n;
    string s;
    cin >> n >> s;
    int now = 0;
    int mx = 0;
    rep(i,n){
        if(s[i]=='I') now++;
        else if(s[i]=='D') now--;
        mx = max(now,mx);
    }
    coiut << mx << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'coiut' was not declared in this scope
   23 |     coiut << mx << endl;
      |     ^~~~~
Language: C++

#include <stdio.h>

int main(){
    int test;
    scanf("%d", &test);
    char word[test];
    int x = 0;
    int max = 0;
    for(int i = 0; i < n; i++){
        scanf("%c", &word[i]);
        if(str[i] == 'D'){
            x--;
        }else{
            x++;
        }
        if(x > max){
            max = x;
        }
    }
    printf("%d\n", max);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'n' was not declared in this scope
    9 |     for(int i = 0; i < n; i++){
      |                        ^
a.cc:11:12: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |         if(str[i] == 'D'){
      |            ^~~
      |            std
Language: C

#include <bits/stdc++.h>

int main()
{
	int x=0,N;
	scanf("%d",&N);
	char s[N+1];
	scanf("%s",&s);
	int max=0;
	for(int i=0;i<N;i++){
		if(s[i]=='I'){
			x++;
		}else{
			x--;
		}
		if(max<x){
			max=x;
		}
	}
	printf("%d\n",max);
 	return 0;
}



Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
 
typedef vector<int> vi;;
typedef vector<ll> vll;

#define l() length()
#define sz() size()
 
#define b() begin()
#define e() end()
#define all(x) x.begin(), x.end()
 
#define pb(i) push_back(i)
#define PB() pop_back()
 
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
#define mp make_pair
#define Fi first
#define Se second
 
const int maxx=1e6+9;
 
// Happy Coding!

// 1 way is to find compute all the sorted permutations and find the 
// positions of the current permutation.

int _find(string &str){
    int x=0;
    int ans=0;
    for(const char &ch : str){
        if(ch=='I'){
            x++;
        }
        else{
            x--;
        }
        // cout<<x<<" ";
        ans=max(ans,x);
    }

Compiler output:
a.cc: In function 'int _find(std::string&)':
a.cc:46:6: error: expected '}' at end of input
   46 |     }
      |      ^
a.cc:34:23: note: to match this '{'
   34 | int _find(string &str){
      |                       ^
a.cc:46:6: warning: no return statement in function returning non-void [-Wreturn-type]
   46 |     }
      |      ^
Language: C++

#include<bits.stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  int A=0;
  int Ans=0;
  string S; cin>>S;
  for(int i=0; i<N; i++){
    if(S.at(i)=='I')
      A++;
      else A--;
    Ans=max(Ans,A);
  }
  cout<<Ans<<endl;
}
  

Compiler output:
a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
    1 | #include<bits.stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
template <typename T> using vec = vector<T>;

int main()
{
    int n;
    cin >> n;
    char c;
    int x,M;
    for (int i = 0; i < n; i++)
    {
        cin >> c;
        if (c=='I')
        {
            x++;
        }
        else
        {
            x--;
        }
        M = max(x.M);
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: request for member 'M' in 'x', which is of non-class type 'int'
   22 |         M = max(x.M);
      |                   ^
Language: C++

n=int(input())
s=input()
t=0
m=0
for x in s:
    if x=='I': t+=1
    else: t-=1
    m = max(m, t)
print(max(m, 0))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leadinz zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
string text="abcdefghijklmnopqrstuvwxyz";
const int maxn=1e6+7;
//        .--------------.
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'
ll bin_pow(ll a,ll b,ll m)
{
    ll res=1;
    a%=m;
    while(b>0){
        if(b&1)res=res*a%m;
        b>>=1;
        a=a*a%m;
    }
    return res;
}
bool miller_rabin(ll d,ll n)
{
    ll a=2+rand()%(n-4);
    ll x=bin_pow(a,d,n);
    if(x==1 || x==n-1)return true;
    while(d!=n-1){
        x=(x*x)%n;
        d*=2;
        if(x==1)return false;
        if(x==n-1)return true;
    }
    return false;
}
bool prime(ll n,ll k)
{
    if(n==1 || n==4)return false;
    if(n<=3)return true;
    ll d=n-1;
    while(d%2==0)d/=2;
    for(int i=0;i<k;i++){
        if(!miller_rabin(d,n))return false;
    }
    return true;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    string s;
    cin>>n>>s;
    int cnt=0;
    mx=0;
    for(auto x: s){
        if(x=='I')cnt++;
        if(x=='D')cnt--;
        mx=max(mx,cnt);
    }
    cout<<mx<<endl;
}


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

#include <iostream>
#include <vector>
using namespace std;


int main(void){
    int n;
    string s;
    cin >> n;
    cin >> s;
    int t = 0;
    int ans = 0;
    for(int i = 0;i < n;i++{
        switch(s[i]){
            case 'I':
                t++;
                ans = max(ans,t);
                break;
            case 'D':
                t--;
                break;
            default:
            break;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: expected ')' before '{' token
   13 |     for(int i = 0;i < n;i++{
      |        ~                   ^
      |                            )
Language: C++

#include <iostream>
#include <vector>
using namespace std;


int main(void){
    int n;
    string s;
    cin >> n;
    cin >> s;
    int t = 0;
    int ans = 0;
    for(int i = 0;i < n;i++{
        switch(s[i]){
            case 'I':
                t++;
                ans = max(ans,t);
                break;
            case 'D':
                t--;
                break;
            default:
            break;
        }
    }
    cout << ans << endl;
     
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: expected ')' before '{' token
   13 |     for(int i = 0;i < n;i++{
      |        ~                   ^
      |                            )