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

#include<iostream>
using namespace std;
int main() { // input
int N; cin >> N;
vector<int> H(N);
for (int i = 0; i < N; ++i) {
cin >> H[i]; }
// compute
int ans = 0;
for (int i = 0; i < N; ++i) {
bool is_candidate = true;
for (int j = 0; j < i; ++j) {
if (H[j] > H[i]) { is_candidate = false; break;
} }
if (is_candidate) { ++ans;
} }
// output
cout << ans << endl; }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'vector' was not declared in this scope
    5 | vector<int> H(N);
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:8: error: expected primary-expression before 'int'
    5 | vector<int> H(N);
      |        ^~~
a.cc:7:8: error: 'H' was not declared in this scope
    7 | cin >> H[i]; }
      |        ^
a.cc:13:5: error: 'H' was not declared in this scope
   13 | if (H[j] > H[i]) { is_candidate = false; break;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if(a==b){
  cout<<2*a<<endl;
  }
  else{
    cout<<max(a,b)+max(a,b)-1)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before ')' token
   10 |     cout<<max(a,b)+max(a,b)-1)<<endl;
      |                              ^
      |                              ;
Language: C++

#include<bits/stdc+.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if(a==b){
  cout<<2*a<<endl;
  }
  else{
    cout<<max(a,b)+max(a,b)-1)<<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 <stdio.h>
 
int main() {
	int s,a,b;
    
   scanf("%d",&a);
   scanf("%d",&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;


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

#include <stdio.h>
 
int main() {
	int s,a,b;
    
   scanf("%d",&a);
   scanf("%d",&b)
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected ';' before 'if'
    7 |    scanf("%d",&b)
      |                  ^
      |                  ;
    8 | 
    9 |    if (a==b) {
      |    ~~
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
# define ll long long
int main (){
    string s;
    cin >> s;
    int c1, c2;
    for (int i = 0; i < s.size(); i++){
        if (i % 2 == 0){
            if (s[i] == '0'){
                c1++;
            } else {
                c2++;
            }
        } else {
            if (s[i] == '1'){
                c2++;
            } else {
                c1++;
            }
        
        int ans;
        if (c1 <= c2) ans = c1;
        else ans = c2;
        cout << ans << endl;
        return 0;
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:13:39: note: to match this '{'
   13 |     for (int i = 0; i < s.size(); i++){
      |                                       ^
a.cc:32:6: error: expected '}' at end of input
   32 |     }
      |      ^
a.cc:9:12: note: to match this '{'
    9 | int main (){
      |            ^
Language: C++

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

int main(){
  int A,B;cin>>A>>B;
  ans=2*A-1;
  ans=max(ans, 2*B-1);
  ans=max(ans, A+B);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |   ans=2*A-1;
      |   ^~~
      |   abs
Language: C

#include <stdio.h>
 
int main() {
	int s,a,b;
    
   scanf_s("%d%d", &a, &b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:4: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |    scanf_s("%d%d", &a, &b);
      |    ^~~~~~~
      |    scanf
Language: C

#include <stdio.h>
 
int main() {
	int s,a,b;
    
   scanf_s("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:4: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |    scanf_s("%d%d",&a,&b);
      |    ^~~~~~~
      |    scanf
Language: C++

a,b=(int(x) for x in input().split())
ans=0
for i in range(2):
    if a>b:
        ans+=a
        a-=1
    else:
        ans+=b
        b-=1
            
print(ans)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b=(int(x) for x in input().split())
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  int x = 1;
  cin >> n;
  int h[n];
  for(int i = 0;i < n;i++){
    cin >> h[i];
  }
  int max = h[0];
  for(int j = 1;j < n;j++){
    break if(h[j] < max)
    max = h[j];
    x++;
  }
  cout << x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected ';' before 'if'
   13 |     break if(h[j] < max)
      |          ^~~
      |          ;
Language: C++

#include<iostream>
 
using namespace std;
 
int main(){
  int A,B;
  cin >> A >> B;
  
  int sum=0;
  
  for(int i = 0; i < 2; i++){
    if( A >= B ){
      sum += A;
      A--;
    }else{
      sum += B;
      B--;
    }
  }
  
  cout << sum << endl
    
    return 0;
}


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

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#include<vector>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}
/*

 */
int n, k;
string s;

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

  vector<int> a,b;
  a.push_back(0);
  b.push_back(0);
  int cnt = 0;
  for (size_t i = 0; i < n; i++)
  {
    if(s[i]=='1'){
      if(cnt==0){
        a.push_back(i);
      }
      cnt++;
    } else {
      if(cnt>0){
        b.push_back(i);
        cnt = 0;
      }
    }
  }
  a.push_back(n);
  b.push_back(n);

  int m = min(a.size(), b.size());

/*   for (size_t i = 0; i < m; i++)
  {
    cerr << "a[i] = "<< a[i] << ", b[i] = "<< b[i] << endl;
  } */

  /* int ans = 0;
  for (size_t i = 0; i < m-k; i++)
  {
    ans = max(ans, b[i + k] - a[i]);
  }
 */
  if(m<=k){
    ans = n;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   68 |     ans = n;
      |     ^~~
      |     abs
a.cc:70:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   70 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include <stdio.h>
 
int main(void) {
	int s,a,b;
    
   scanf_s("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;


Compiler output:
main.c: In function 'main':
main.c:6:4: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |    scanf_s("%d%d",&a,&b);
      |    ^~~~~~~
      |    scanf
main.c:16:3: error: expected declaration or statement at end of input
   16 |   return 0;
      |   ^~~~~~
Language: C++

#include<iostream>
2. 
3.using namespace std;
4. 
5.int main(){
6.  int A,B;
7.  cin >> A >> B;
8.  
9.  int sum=0;
10.  
11.  for(int i = 0; i < 2; i++){
12.    if( A >= B ){
13.      sum += A;
14.      A--;
15.    }else{
16.      sum += B;
17.      B--;
18.    }
19.  }
20.  
21.  cout << sum << endl;
22.    
23.    return 0;
24.}


Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.
      | ^~
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4.
      | ^~
Language: C++

#include<iostream>

using namespace std;

int main(){
  int A,B;
  cin >> A >> B;
  
  int sum=0;
  
  for(int i = 0; i < 2; i++){
    if( A >= B ){
      sum += A;
      A--;
    }else{
      sum += B;
      B--;
    }
  }
  
  cout << sum << endl
    
    return 0;
}

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

#include <stdafx.h>
 
int main(void) {
	int s,a,b;
    
   scanf("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  return 0;
}

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

#include<iostream>
using namespace std;

int main()
{
  int a,b;
  cin >> a >> b;
  if(a==b) cout << 2*a;
  else id(a>b) cout << 2*a-1;
  else cout << 2*b-1;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'id' was not declared in this scope
    9 |   else id(a>b) cout << 2*a-1;
      |        ^~
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else cout << 2*b-1;
      |   ^~~~
Language: C

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string.h>
using namespace std;

int main(void) {
	int a, b, sum = 0;
	scanf("%d %d", &a, &b);
	for (int i = 0; i < 2; i++) {
		if (a >= b) {
			sum += a;
			a--;
		}
		else {
			sum += b;
			b--;
		}
	}
	printf("%d\n", sum);
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(Syste.in);
      	int a = scan.nextInt();
      	int b = scan.nextInt();
      	int n = a + b;
      	int m = a + a - 1;
      	int o = b + b - 1;
      	int ans = n;
      	if(n < m){
        	ans = m;
			if(m < o){
            	ans = o;
            }
        }
      	else {
        	if(n < o){
            	ans = o;
            }
        }
      	System.out.print(ans);
    
    }

}

Compiler output:
Main.java:5: error: cannot find symbol
    	Scanner scan = new Scanner(Syste.in);
    	                           ^
  symbol:   variable Syste
  location: class Main
1 error
Language: C

#include<stdio.h>
int main()
{
  float A,B,C,X,S;
  scanf("%f",&A);
  scanf("%f",&B);
  3<=A&&B<=20;
  printf("%f %f",A,B);
  C=A-1;
  X=B-1;
  if(C>B&&A>B)
  {
    S=A+C;
    printf("合計は%f",S);
  }
  else if(C<B&&A>B)
  {
    S=A+B;
    printf("合計は%f",S);
  }
  else(X>A&&B>A)
  {
    S=B+X;
    printf("合計は%f",S);
  }
  else(X<A&&B>A)
  {
    S=B+A;
    printf("合計は%f",S);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:17: error: expected ';' before '{' token
   21 |   else(X>A&&B>A)
      |                 ^
      |                 ;
   22 |   {
      |   ~
Language: C++

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

int main(){
  int A;
  int B;
 int ans;
  cin >> A >>B;

  if(A>B){

if(A - B > 1){ans = A+ (A-1)
}else{ans = A+ B}

}else if(A<B){

if(B-A > 1){ans = B + (B-1)
}else{ans =A+B}

}

cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: expected ';' before '}' token
   12 | if(A - B > 1){ans = A+ (A-1)
      |                             ^
      |                             ;
   13 | }else{ans = A+ B}
      | ~                            
a.cc:13:17: error: expected ';' before '}' token
   13 | }else{ans = A+ B}
      |                 ^
      |                 ;
a.cc:17:28: error: expected ';' before '}' token
   17 | if(B-A > 1){ans = B + (B-1)
      |                            ^
      |                            ;
   18 | }else{ans =A+B}
      | ~                           
a.cc:18:15: error: expected ';' before '}' token
   18 | }else{ans =A+B}
      |               ^
      |               ;
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
 
int main(void) {
	int s,a,b;
    
   scanf("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
  printf("%d\n",s);
  
  return 0
}

Compiler output:
main.c: In function 'main':
main.c:18:11: error: expected ';' before '}' token
   18 |   return 0
      |           ^
      |           ;
   19 | }
      | ~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
 if(b>a)
   swap(a,b);
  
  if(a==b)
    cout<<2*a<<endl;
  else
    cout<<2*a-1<<endl;
   

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected '}' at end of input
   14 |     cout<<2*a-1<<endl;
      |                       ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  cin >> A, B;
  int ans = 0;
  for (int i = 0; i < 2; i++) {
    ans += max(A, B);
    if (max(A, B) == A) {
      A--;
    }
    else {
      B--;
    }
  }
  cout << ans << endl;
}#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  cin >> A, B;
  int ans = 0;
  for (int i = 0; i < 2; i++) {
    ans += max(A, B);
    if (max(A, B) == A) {
      A--;
    }
    else {
      B--;
    }
  }
  cout << ans << endl;
}

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

import java.util.Scanner;

/**
 * Created by dezhonger on 2019/4/13
 */
public class A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        long r = 0;
        if (a > b) {
            r += a;
            a--;

        } else {
            r+= b;
            b--;
        }
        r += Math.max(a, b);
        System.out.println(r);
    }
}


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

#include<stdio.h>
int main(){
  int large_a=0;
  int large_b=0;
  int min_1=0;
  int min_2=0;
  int max=0;
  scanf("%d %d",&large_a,&large_b);
  min_1=large_a-large_b;
  if(min_1>0)
  {
    min_2=min_1-1;
    if(min_2>0)
    {
      max=large_a*2-1;
    }else 
    {
      max=large_a+large_b;
    }
  }else()
  {
    min_2=large_b-large_a-1;
    if(min_2>0)
    {
      max=large_b*2-1;
    }else
    {
      max=large_a+large_b;
    }
  }
  printf("%d",max);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: expected expression before ')' token
   20 |   }else()
      |         ^
Language: Java

import java.util.Scanner;
import java.util.ArrayList;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new Scanner(System.in());
    List<int> list = new ArrayList<int>();
    while(scan.hasnextInt()){
      list.add(scan.nextInt());
    }
    list.add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public ArrayList getcoin(ArrayList list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }

}


Compiler output:
Main.java:7: error: cannot find symbol
    Scanner scan = new Scanner(System.in());
                                     ^
  symbol:   method in()
  location: class System
Main.java:8: error: cannot find symbol
    List<int> list = new ArrayList<int>();
    ^
  symbol:   class List
  location: class Main
Main.java:8: error: unexpected type
    List<int> list = new ArrayList<int>();
         ^
  required: reference
  found:    int
Main.java:8: error: unexpected type
    List<int> list = new ArrayList<int>();
                                   ^
  required: reference
  found:    int
Main.java:9: error: cannot find symbol
    while(scan.hasnextInt()){
              ^
  symbol:   method hasnextInt()
  location: variable scan of type Scanner
Main.java:16: error: incompatible types: unexpected return value
    return list.get(2);
                   ^
Main.java:19: error: incompatible types: Object cannot be converted to int
      int a = list.get(0);
                      ^
Main.java:20: error: incompatible types: Object cannot be converted to int
      int b = list.get(1);
                      ^
Main.java:21: error: incompatible types: Object cannot be converted to int
      int sum = list.get(2);
                        ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
Language: C

#include<stdio.h>
int main(){
  int large_a=0;
  int large_b=0;
  int min_1=0;
  int min_2=0;
  int max=0;
  scanf("%d%d",&large_a,&large_b);
  min_1=large_a-large_b;
  if(min_1>0)
  {
    min_2=min_1-1;
    if(min_2>0)
    {
      max=large_a*2-1;
    }else 
    {
      max=large_a+large_b;
    }
  }else()
  {
    min_2=large_b-large_a-1;
    if(min_2>0)
    {
      max=large_b*2-1;
    }else
    {
      max=large_a+large_b;
    }
  }
  printf("%d",max);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: expected expression before ')' token
   20 |   }else()
      |         ^
Language: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new Scanner(System.in());
    List<int> list = new ArrayList<int>();
    while(scan.hasnextInt()){
      list.add(scan.nextInt());
    }
    list.add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public ArrayList getcoin(ArrayList list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }

}


Compiler output:
Main.java:2: error: cannot find symbol
import java.util.Arraylist;
                ^
  symbol:   class Arraylist
  location: package java.util
Main.java:18: error: cannot find symbol
  public ArrayList getcoin(ArrayList list){
                           ^
  symbol:   class ArrayList
  location: class Main
Main.java:18: error: cannot find symbol
  public ArrayList getcoin(ArrayList list){
         ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    Scanner scan = new Scanner(System.in());
                                     ^
  symbol:   method in()
  location: class System
Main.java:8: error: cannot find symbol
    List<int> list = new ArrayList<int>();
    ^
  symbol:   class List
  location: class Main
Main.java:8: error: unexpected type
    List<int> list = new ArrayList<int>();
         ^
  required: reference
  found:    int
Main.java:8: error: cannot find symbol
    List<int> list = new ArrayList<int>();
                         ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: unexpected type
    List<int> list = new ArrayList<int>();
                                   ^
  required: reference
  found:    int
Main.java:9: error: cannot find symbol
    while(scan.hasnextInt()){
              ^
  symbol:   method hasnextInt()
  location: variable scan of type Scanner
Main.java:16: error: incompatible types: unexpected return value
    return list.get(2);
                   ^
10 errors
Language: C

#include<stdio.h>
int main(){
  int large_a=0;
  int large_b=0;
  int min_1=0;
  int min_2=0;
  int max=0;
  scanf("%d%d",&large_a,large_b);
  min_1=large_a-large_b;
  if(min_1>0)
  {
    min_2=min_1-1;
    if(min_2>0)
    {
      max=large_a*2-1;
    }else 
    {
      max=large_a+large_b;
    }
  }else()
  {
    min_2=large_b-large_a-1;
    if(min_2>0)
    {
      max=large_b*2-1;
    }else
    {
      max=large_a+large_b;
    }
  }
  printf("%d",max);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: expected expression before ')' token
   20 |   }else()
      |         ^
Language: C++

int main(){
    int a, b, ans;
    cin >> a >> b;

    for(int i = 0; i < 2; i++){
        if(a >= b){
            ans += a;
            a--;
        }
        else{
            ans += b;
            b--;
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> a >> b;
      |     ^~~
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: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new Scanner(System.in());
    List<int> list = new Arraylist<>();
    while(scan.hasnextInt()){
      list.add(scan.nextInt());
    }
    list.add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public Arraylist getcoin(Arraylist list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }

}


Compiler output:
Main.java:2: error: cannot find symbol
import java.util.Arraylist;
                ^
  symbol:   class Arraylist
  location: package java.util
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
                           ^
  symbol:   class Arraylist
  location: class Main
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
         ^
  symbol:   class Arraylist
  location: class Main
Main.java:7: error: cannot find symbol
    Scanner scan = new Scanner(System.in());
                                     ^
  symbol:   method in()
  location: class System
Main.java:8: error: cannot find symbol
    List<int> list = new Arraylist<>();
    ^
  symbol:   class List
  location: class Main
Main.java:8: error: unexpected type
    List<int> list = new Arraylist<>();
         ^
  required: reference
  found:    int
Main.java:8: error: cannot find symbol
    List<int> list = new Arraylist<>();
                         ^
  symbol:   class Arraylist
  location: class Main
Main.java:9: error: cannot find symbol
    while(scan.hasnextInt()){
              ^
  symbol:   method hasnextInt()
  location: variable scan of type Scanner
Main.java:16: error: incompatible types: unexpected return value
    return list.get(2);
                   ^
9 errors
Language: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new Scanner(System.in());
    List<int> list = new Arraylist<>();
    while(Scan(System.in()).hasnextInt()){
      list.add(Scan(System.in()));
    }
    list.add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public Arraylist getcoin(Arraylist list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }

}


Compiler output:
Main.java:2: error: cannot find symbol
import java.util.Arraylist;
                ^
  symbol:   class Arraylist
  location: package java.util
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
                           ^
  symbol:   class Arraylist
  location: class Main
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
         ^
  symbol:   class Arraylist
  location: class Main
Main.java:7: error: cannot find symbol
    Scanner scan = new Scanner(System.in());
                                     ^
  symbol:   method in()
  location: class System
Main.java:8: error: cannot find symbol
    List<int> list = new Arraylist<>();
    ^
  symbol:   class List
  location: class Main
Main.java:8: error: unexpected type
    List<int> list = new Arraylist<>();
         ^
  required: reference
  found:    int
Main.java:8: error: cannot find symbol
    List<int> list = new Arraylist<>();
                         ^
  symbol:   class Arraylist
  location: class Main
Main.java:9: error: cannot find symbol
    while(Scan(System.in()).hasnextInt()){
                     ^
  symbol:   method in()
  location: class System
Main.java:10: error: cannot find symbol
      list.add(Scan(System.in()));
                          ^
  symbol:   method in()
  location: class System
Main.java:16: error: incompatible types: unexpected return value
    return list.get(2);
                   ^
10 errors
Language: C++

#include<stdio.h>
int a, b;
int sum1,sum2,sum3,sum4,,sum5;
int max=0;
int main(){
     scanf("%d %d",&a,&b);
      sum1= a+(a-1);
       sum 2=b+(b-1);
  sum3=a+b; 
  if(max<sum1) max=sum1;
  if(max<sum2) max=sum2;
  if(max<sum3) max=sum3;
  printf("%d\n",max);
  }
        
       
      

Compiler output:
a.cc:3:25: error: expected unqualified-id before ',' token
    3 | int sum1,sum2,sum3,sum4,,sum5;
      |                         ^
a.cc: In function 'int main()':
a.cc:8:8: error: 'sum' was not declared in this scope; did you mean 'sum5'?
    8 |        sum 2=b+(b-1);
      |        ^~~
      |        sum5
Language: C

#include <stdio.h>
 
int main(void) {
	int s,a,b;
    
   scanf("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }

Compiler output:
main.c: In function 'main':
main.c:14:4: error: expected declaration or statement at end of input
   14 |    }
      |    ^
Language: C++

#include<iostream>
using namespace std;

int main(){
 int a,b,c;
   cin >> a >> b;
  if(a>b){
    c += a;
    a--;
  }else if(a<b){
    c += b;
    b--;
  }else(a==b){
    c += a;
    a--;
  }
  if(a>b){
    c += a;
    a--;
  }else if(a<b){
    c += b;
    b--;
  }else(a==b){
    c += a;
    a--;
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before '{' token
   13 |   }else(a==b){
      |              ^
      |              ;
a.cc:23:14: error: expected ';' before '{' token
   23 |   }else(a==b){
      |              ^
      |              ;
Language: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new scanner(System.in());
    List<Int> list = new Arraylist<>();
    while(Scan(System.in).hasnextInt()){
      list.add(Scan(System.in));
    }
    list.add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public Arraylist getcoin(Arraylist list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }

}

Compiler output:
Main.java:2: error: cannot find symbol
import java.util.Arraylist;
                ^
  symbol:   class Arraylist
  location: package java.util
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
                           ^
  symbol:   class Arraylist
  location: class Main
Main.java:18: error: cannot find symbol
  public Arraylist getcoin(Arraylist list){
         ^
  symbol:   class Arraylist
  location: class Main
Main.java:7: error: cannot find symbol
    Scanner scan = new scanner(System.in());
                       ^
  symbol:   class scanner
  location: class Main
Main.java:7: error: cannot find symbol
    Scanner scan = new scanner(System.in());
                                     ^
  symbol:   method in()
  location: class System
Main.java:8: error: cannot find symbol
    List<Int> list = new Arraylist<>();
    ^
  symbol:   class List
  location: class Main
Main.java:8: error: cannot find symbol
    List<Int> list = new Arraylist<>();
         ^
  symbol:   class Int
  location: class Main
Main.java:8: error: cannot find symbol
    List<Int> list = new Arraylist<>();
                         ^
  symbol:   class Arraylist
  location: class Main
Main.java:9: error: cannot find symbol
    while(Scan(System.in).hasnextInt()){
          ^
  symbol:   method Scan(InputStream)
  location: class Main
Main.java:10: error: cannot find symbol
      list.add(Scan(System.in));
               ^
  symbol:   method Scan(InputStream)
  location: class Main
Main.java:16: error: incompatible types: unexpected return value
    return list.get(2);
                   ^
11 errors
Language: C

include <stdio.h>
 
int main(void) {
	int s,a,b;
    
   scanf("%d%d",&a,&b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include <stdio.h>
int main(){
    // Your code here!
    int a,b,max=0;
    scanf("%d %d", &a, &b);
    
    if( a+a-1 > a+(b-1) && a+a-1 > (a-1)+b && a+a-1 > b+b ){
        max = a+a-1;
        printf("%d", max);
    } else if( (a-1)+b > a+a-1 && (a-1)+b > (a-1)+b && (a-1)+b > b+b-1 ){
            max = (a-1)+b;
            printf("%d", max);
    } else　if( (b-1)+a > a+a-1 && (b-1)+a >= (a-1)+b && (b-1)+a >= b+b-1 ){
        　　max = (a-1)+b;
            printf("%d", max);
    } else if( b+b-1 > a+a && b+b-1 > (a-1)+b && b+b-1 >a+(b-1) ){
            max = b+b-1;
            printf("%d", max);
        }
    
    
    return 0;
    }


Compiler output:
main.c: In function 'main':
main.c:13:11: error: stray '\343' in program
   13 |     } else<U+3000>if( (b-1)+a > a+a-1 && (b-1)+a >= (a-1)+b && (b-1)+a >= b+b-1 ){
      |           ^~~~~~~~
main.c:14:9: error: stray '\343' in program
   14 |         <U+3000><U+3000>max = (a-1)+b;
      |         ^~~~~~~~
main.c:14:11: error: stray '\343' in program
   14 |         <U+3000><U+3000>max = (a-1)+b;
      |                 ^~~~~~~~
Language: C

include <stdio.h>

int main(void) {
	int s,a,b;
    
   scanf("%d%d",a,b);
   
   if (a==b) {
    s = a + b;
   } else if (a+1 >= b) {
   	s = a*2 - 1;
   } else {
   	s = b*2 - 1;
   }
   
   printf("%d\n"s);
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: Java

import java.io.* ;
import static java.lang.System.* ;
import java.util.Scanner;
public class Main
{
	public static int main ( String [] args )
	{
		String keyin = null ;
		Scanner scanner = new Scanner(System.in);
		keyin = scanner.nextLine ( ) ;
		int A = Integer.parseInt (keyin ) ;

		Scanner scanner2 = new Scanner(System.in);
		keyin = scanner2.nextLine ( ) ;
		int B = Integer.parseInt ( keyin ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}
		out.println ( total ) ;
	}
}

Compiler output:
Main.java:30: error: missing return statement
	}
	^
1 error
Language: C++

#include<iostream>
using namespace std;

int main(){
 int a,b,c;
   cin >> a >> b;
  if(a>b){
    c += a;
    a--;
  }else if(a<b){
    c += b;
    b--;
  }else(a=b){
    c += a;
    a--;
  }
  if(a>b){
    c += a;
    a--;
  }else if(a<b){
    c += b;
    b--;
  }else(a=b){
    c += a;
    a--;
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected ';' before '{' token
   13 |   }else(a=b){
      |             ^
      |             ;
a.cc:23:13: error: expected ';' before '{' token
   23 |   }else(a=b){
      |             ^
      |             ;
Language: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new scanner(System.in());
    List<Int> list = new Arraylist<>();
    while(Scan(System.in).hasnextInt()){
      list.add(Scan(System.in));
    }
    list add(0);
    for(int i = 0; i<=2; i++){
      list = getcoin(list);
    }
    return list.get(2);
  }
  public Arraylist getcoin(Arraylist list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }



Compiler output:
Main.java:12: error: ';' expected
    list add(0);
            ^
Main.java:33: error: reached end of file while parsing
    }
     ^
2 errors
Language: C++

#include<iostream>
using namespace std;

int main(){
 int a,b,c;
   cin >> a >> b;
  For(int x;x<3;x++){
  if(a>b){
    c += a;
    a--;
  }else if(a<b){
    c += b;
    b--;
  }else(a=b){
    c += a;
    a--;
  }
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   For(int x;x<3;x++){
      |       ^~~
a.cc:7:13: error: 'x' was not declared in this scope
    7 |   For(int x;x<3;x++){
      |             ^
Language: C

#include<stdio.h>
int main(){
  int large_a=0;
  int large_b=0;
  int min_a=0;
  int min_b=0;
  int min_c=0;
  int min_d=0;
  int max=0;
  scanf_s("%d%d",&large_a,&large_b);
  min_a=large_a-large_b;
  min_b=large_b-large_a;
  if(min_a>0)
  {
    min_c=min_a-1;
    if(min_c>0)
    {
      max=large_a*2-1;
    }else 
    {
     max=large_a+large_b;
    }
  }
  if(min_b>0)
  {
    min_d=large_b-1;
    if(min_d>0)
    {
      max=large_b*2-1;
    }
  }
  printf("%d",max);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |   scanf_s("%d%d",&large_a,&large_b);
      |   ^~~~~~~
      |   scanf
Language: C++

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

int main() {
  int A,B;
  int S;
  cin >> A,B;
  if(A < B){
    S = 2B-1;
    cout << S << endl;
  }
  if(A > B){
    S = 2A-1;
    cout << S << endl;
  }
    else{
      S = A+B;
      cout << S <<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: unable to find numeric literal operator 'operator""B'
    9 |     S = 2B-1;
      |         ^~
a.cc:13:9: error: unable to find numeric literal operator 'operator""A'
   13 |     S = 2A-1;
      |         ^~
Language: Java

import java.util.Scanner;
import java.util.Arraylist;

public class Main{
  public static void main(String[] args){
    
    Scanner scan = new scanner(System.in());
    List<Int> list = new Arraylist<>();
    while(Scan(System.in).hasnextInt()){
      list.add(Scan(System.in));
    }
    list add(0);
    
    public Arraylist getcoin(Arraylist list){
      int a = list.get(0);
      int b = list.get(1);
      int sum = list.get(2);
      if ( a>= b ) {
        sum = sum+a;
        a = a-1;
      }else{
        sum = sum + b;
        b = b-1;
      }
      list.set(0,a);
      list.set(1,b);
      list.set(2,sum);
      return list;
    }
    for(int i = 0; i<=2; i++){
      list = getcoin(list)
    }
    return list.get(2);

      
      


Compiler output:
Main.java:12: error: ';' expected
    list add(0);
            ^
Main.java:14: error: illegal start of expression
    public Arraylist getcoin(Arraylist list){
    ^
Main.java:30: error: illegal start of type
    for(int i = 0; i<=2; i++){
    ^
Main.java:30: error: <identifier> expected
    for(int i = 0; i<=2; i++){
                    ^
Main.java:30: error: <identifier> expected
    for(int i = 0; i<=2; i++){
                          ^
Main.java:31: error: ';' expected
      list = getcoin(list)
                          ^
Main.java:33: error: illegal start of type
    return list.get(2);
    ^
Main.java:33: error: <identifier> expected
    return list.get(2);
                   ^
Main.java:33: error: illegal start of type
    return list.get(2);
                    ^
Main.java:33: error: reached end of file while parsing
    return list.get(2);
                       ^
10 errors
Language: C++

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

int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int x,y,z;
	x=a+a-1;
	y=b+b-1;
	z=a+b;
	if(a>b&&a>c) printf("%d",a);
	else if(b>a&&b>c) printf("%d",b);
	else printf|("%d",c);

	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'c' was not declared in this scope
   13 |         if(a>b&&a>c) printf("%d",a);
      |                   ^
Language: C

#include<stdio.h>
int main() {
  int A, B;
  scanf("%d", &A);
  scanf("%d", &B);
  if (A < B) 
    A = B;
  }
  int ans = A;
  ans = ans*2 - 1;
  printf("%d", ans);

  return 0;
}

Compiler output:
main.c:9:13: error: 'A' undeclared here (not in a function)
    9 |   int ans = A;
      |             ^
main.c:10:3: warning: data definition has no type or storage class
   10 |   ans = ans*2 - 1;
      |   ^~~
main.c:10:3: error: type defaults to 'int' in declaration of 'ans' [-Wimplicit-int]
main.c:10:3: error: redefinition of 'ans'
main.c:9:7: note: previous definition of 'ans' with type 'int'
    9 |   int ans = A;
      |       ^~~
main.c:10:9: error: initializer element is not constant
   10 |   ans = ans*2 - 1;
      |         ^~~
main.c:11:10: error: expected declaration specifiers or '...' before string constant
   11 |   printf("%d", ans);
      |          ^~~~
main.c:11:16: error: expected declaration specifiers or '...' before 'ans'
   11 |   printf("%d", ans);
      |                ^~~
main.c:13:3: error: expected identifier or '(' before 'return'
   13 |   return 0;
      |   ^~~~~~
main.c:14:1: error: expected identifier or '(' before '}' token
   14 | }
      | ^
Language: Java

import java.io.* ;
import static java.lang.System.* ;
import java.util.Scanner;
public class Main
{
	public static int main ( String [] args )
	{
		String keyin = null ;
		Scanner scanner = new Scanner(System.in);
		keyin = scanner.nextLine ( ) ;
		int A = Integer.parseInt (keyin ) ;

		Scanner scanner = new Scanner(System.in);
		keyin = scanner.nextLine ( ) ;
		int B = Integer.parseInt ( keyin ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

Compiler output:
Main.java:13: error: variable scanner is already defined in method main(String[])
		Scanner scanner = new Scanner(System.in);
		        ^
1 error
Language: C

#include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
         
        int main()
        {
         int a,b,c=0,i;
         scanf("%d %d", &a &b);
          
         for(i=0;i>2;i++){
           if(a>=b){
           	c=c+a;
           	a=a-1;}
           else{
           	c=c+b;
           	b=b-1;}
         }
         
         printf("%d",c);
         return 0;
        }

Compiler output:
main.c: In function 'main':
main.c:8:28: error: invalid operands to binary & (have 'int *' and 'int')
    8 |          scanf("%d %d", &a &b);
      |                         ~~ ^
      |                         |
      |                         int *
Language: Java

import java.io.* ;
import static java.lang.System.* ;
import java.util.Scanner;
public class Main
{
	public static int main ( String [] args )
	{
		String keyin = null ;
		Scanner scanner = new Scanner(System.in);
		keyin = scanner.nextLine ( ) ;
		int A = keyin.nextInt() ;
		int B = keyin.nextInt() ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
		int A = keyin.nextInt() ;
		             ^
  symbol:   method nextInt()
  location: variable keyin of type String
Main.java:12: error: cannot find symbol
		int B = keyin.nextInt() ;
		             ^
  symbol:   method nextInt()
  location: variable keyin of type String
2 errors
Language: C++

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

int main(){
  int A, B;
  cin >> A >> B;
  cout << (A == B ? m + m : m + m - 1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'm' was not declared in this scope
    7 |   cout << (A == B ? m + m : m + m - 1) << endl;
      |                     ^
Language: Java

public class Main
{
	public static int main ( String [] args )
	{
		String keyin = null ;
		Scanner scanner = new Scanner(System.in);
		keyin = scanner.nextLine ( ) ;
		int A = Integer.parseInt ( keyin ) ;
		int B = Integer.parseInt ( keyin ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

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

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
         
        int main()
        {
         int a,b,c=0,i;
         scanf("%d %d", &a &b);
          
         for(i=0;i>2;i++){
           if(a>=b){
           	c=c+a;
           	a=a-1;}
           else{
           	c=c+b;
           	b=b-1;}
         }
         
         printf{"%d",c};
         return 0;
        }

Compiler output:
main.c: In function 'main':
main.c:8:28: error: invalid operands to binary & (have 'int *' and 'int')
    8 |          scanf("%d %d", &a &b);
      |                         ~~ ^
      |                         |
      |                         int *
main.c:19:16: error: expected ';' before '{' token
   19 |          printf{"%d",c};
      |                ^
      |                ;
Language: C++

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

int main() {
  int A,B;
  int S;
  cin >> A,B;
  if(A < B){
    S = B+B-1
    cout << S << endl;
  }
  if(A > B){
    S = A+A-1
    cout << S << endl;
  }
    else{
      S = A+B
      cout << S <<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before 'cout'
    9 |     S = B+B-1
      |              ^
      |              ;
   10 |     cout << S << endl;
      |     ~~~~      
a.cc:13:14: error: expected ';' before 'cout'
   13 |     S = A+A-1
      |              ^
      |              ;
   14 |     cout << S << endl;
      |     ~~~~      
a.cc:17:14: error: expected ';' before 'cout'
   17 |       S = A+B
      |              ^
      |              ;
   18 |       cout << S <<endl;
      |       ~~~~
Language: Java

import static java.lang.System.* ;
import java.util.Scanner;
public class Main
{

	public static String input ( )
	{
		try
		{
			String keyin = null ;
			Scanner scanner = new Scanner(System.in);
			keyin = scanner.nextLine ( ) ;
			return keyin ;
		}
		catch ( IOException e )
		{
			throw new InternalError ( e.toString ( ) + "発生のため") ;
		}
	}	

	public static int main ( String [] args )
	{
		int A = Integer.parseInt (input ( ) ) ;
		int B = Integer.parseInt (input ( ) ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

Compiler output:
Main.java:15: error: cannot find symbol
		catch ( IOException e )
		        ^
  symbol:   class IOException
  location: class Main
1 error
Language: C++

#include <cstdio>

#define max(a, b) (a<=b ? b : a)

int main()
{
  int a=b=0;
  scanf("%d %d", &a, &b);
  printf("%d", max((a + max(a-1, b)), (b + max(a, b-1))));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'b' was not declared in this scope
    7 |   int a=b=0;
      |         ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
     
    int main()
    {
     int a,b,c=0,i;
     scanf("%d %d", &a &b);
      
     for(i=0;i>2;i++){
       if(a>=b){
       	c=c+a;
       	a=a-1}
       else{
       	c=c+b;
       	b=b-1}
     }
     
     printf{"%d",c};
     return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:8:24: error: invalid operands to binary & (have 'int *' and 'int')
    8 |      scanf("%d %d", &a &b);
      |                     ~~ ^
      |                     |
      |                     int *
main.c:13:14: error: expected ';' before '}' token
   13 |         a=a-1}
      |              ^
      |              ;
main.c:16:14: error: expected ';' before '}' token
   16 |         b=b-1}
      |              ^
      |              ;
main.c:19:12: error: expected ';' before '{' token
   19 |      printf{"%d",c};
      |            ^
      |            ;
Language: Java

import java.io.* ;
import static java.lang.System.* ;
import java.util.Scanner;
public class Main
{

	public static String input ( )
	{
		try
		{
			String keyin = null ;
			Scanner scanner = new Scanner(System.in);
			keyin = scanner.readLine ( ) ;
			return keyin ;
		}
		catch ( IOException e )
		{
			throw new InternalError ( e.toString ( ) + "発生のため") ;
		}
	}	

	public static int main ( String [] args )
	{
		int A = Integer.parseInt (input ( ) ) ;
		int B = Integer.parseInt (input ( ) ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
			keyin = scanner.readLine ( ) ;
			               ^
  symbol:   method readLine()
  location: variable scanner of type Scanner
1 error
Language: Java

import java.io.* ;
import static java.lang.System.* ;
public class Main
{

	public static String input ( )
	{
		try
		{
			String keyin = null ;
			Scanner scanner = new Scanner(System.in);
			keyin = scanner.readLine ( ) ;
			return keyin ;
		}
		catch ( IOException e )
		{
			throw new InternalError ( e.toString ( ) + "発生のため") ;
		}
	}	

	public static int main ( String [] args )
	{
		int A = Integer.parseInt (input ( ) ) ;
		int B = Integer.parseInt (input ( ) ) ;
		int total = 0 ;

		for ( int i = 0 ; i > 1 ; i ++ )
		{
			if ( A > B )
			{
				total += A ;
			}
			else
			{
				total += B ;
			}
		}

		return total ;
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
			Scanner scanner = new Scanner(System.in);
			^
  symbol:   class Scanner
  location: class Main
Main.java:11: error: cannot find symbol
			Scanner scanner = new Scanner(System.in);
			                      ^
  symbol:   class Scanner
  location: class Main
2 errors