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

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

int main(int argc, char *argv[])
{
  int a=0,b=0,i;
  int res=0;
  a=atoi(argv[1]);
  b=atoi(argv[2]);
  for(i=0;i<2;i++){
    if(a>b)
    {
      res=res+a;
      a--;
    }
    else
    {
      res=res+b;
      b--;
    }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << res << endl;
      |   ^~~~
a.cc:22:18: error: 'endl' was not declared in this scope
   22 |   cout << res << endl;
      |                  ^~~~
Language: C++

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

int main(int argc, char *argv[])
{
  int a=0,b=0,i;
  int res=0;
  a=atoi(argv[1]);
  b=atoi(argv[2]);
  for(i=0;i<2;i++){
    if(a>b)
    {
      res=res+a;
      a--;
    }
    else
    {
      res=res+b;
      b--;
    }
  }
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char *argv[])
{
  int a=0,b=0,i;
  int res=0;
  a=atoi(argv[1]);
  b=atoi(argv[2]);
  for(i=0;i<2;i++){
    if(a>b)
    {
      res=res+a;
      a--;
    }
    else
    {
      res=res+b;
      b--;
    }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:26:1: error: a function-definition is not allowed here before '{' token
   26 | {
      | ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sn = new Scanner(System.in);
    int a;
    int b;
    int count;
    int button;
    while(true) {
    	a = sn.nextInt();
      	if (a > 3) {
          return
        }
    }
    while(true) {
    	b = sn.nextInt();
      	if (b < 20) {
          return
        }
    }
    do {
      	System.out.println("どのボタン? (0)A  (1)B");
   		 button = sn.nextInt();
   		 if(button == 0) {
           count += a--;
         }
   		 if(button == 0) {
           count += b--;
    }while(a < 0 || b < 0);
  }
}
      
    

Compiler output:
Main.java:14: error: illegal start of expression
        }
        ^
Main.java:20: error: illegal start of expression
        }
        ^
Main.java:31: error: while expected
  }
   ^
Main.java:32: error: illegal start of expression
}
^
Main.java:32: error: reached end of file while parsing
}
 ^
5 errors
Language: C++

#include<iostream>
#include<algorithm>
 using namespace std:
    
int main(){
  int A, B;
  cin >> A >> B;
  
  int ans = 0;
  ans = max(ans, A + A - 1);
  ans = max(ans, A + B);
  ans = max(ans, B + B -1);
  
  cout << ans << end;
}

Compiler output:
a.cc:3:21: error: expected ';' before ':' token
    3 |  using namespace std:
      |                     ^
      |                     ;
a.cc:3:21: error: expected unqualified-id before ':' token
Language: C++

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


Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:14:   required from here
    7 |   cout << max(a+b, 2*a-1, 2*b-1)<< endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: unable to find numeric literal operator 'operator""a'
    7 |   cout << max(a+b, 2a-1, 2b-1)<< endl;
      |                    ^~
a.cc:7:26: error: unable to find numeric literal operator 'operator""b'
    7 |   cout << max(a+b, 2a-1, 2b-1)<< endl;
      |                          ^~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: unable to find numeric literal operator 'operator""a'
    7 |   cout << max({a+b, 2a-1, 2b-1})<< endl;
      |                     ^~
a.cc:7:27: error: unable to find numeric literal operator 'operator""b'
    7 |   cout << max({a+b, 2a-1, 2b-1})<< endl;
      |                           ^~
a.cc:7:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 |   cout << max({a+b, 2a-1, 2b-1})<< endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: unable to find numeric literal operator 'operator""a'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |                     ^~
a.cc:7:27: error: unable to find numeric literal operator 'operator""b'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |                           ^~
a.cc:7:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |           ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'b'
    5 |   int a b;
      |         ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b;
      |               ^
a.cc:7:21: error: unable to find numeric literal operator 'operator""a'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |                     ^~
a.cc:7:27: error: unable to find numeric literal operator 'operator""b'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |                           ^~
a.cc:7:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 |   cout << max({a+b, 2a-1, 2b-1});
      |           ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){

  
  int A,B;
  
  cin>>A>>B;
  
  int maxi;
  int result;
  
 if(A<B){
result = B*2-1 ;
 }
  if(A>B){
    
   result = A*2-1;
  }
  if(A==B){
    
    result = A*2;
  }
  
  cout<<resulr<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'resulr' was not declared in this scope; did you mean 'result'?
   27 |   cout<<resulr<<endl;
      |         ^~~~~~
      |         result
Language: C++

#include<bits/stdc++>

using namespace std;

int main(){

  
  int A,B;
  
  cin<<A<<B;
  
  int maxi;
  int result;
  
 if(A<B){
result = B*2-1 ;
 }
  if(A>B){
    
   result = A*2-1;
  }
  if(A==B){
    
    result = A*2;
  }
  
  cout<<resulr<<endl;
}


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

def func(a, b):
    if a > b:
        return 2*a - 1
    elif a < b:
        return 2*b - 1
    else:
        return 2*a

[sa, sb] = input().split()
a = int(sa)
b = int(sb)
print(func(a,b))


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def func(a, b):
      | ^~~
Language: C++

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

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



Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >>a>>b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for (int i = 0; i < 2; i++) {
      | ^~~
a.cc:6:17: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                 ^
a.cc:6:24: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                        ^
Language: C++

#include <stdio.h>
using namespace std;

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



Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin <<a<<b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for (int i = 0; i < 2; i++) {
      | ^~~
a.cc:6:17: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                 ^
a.cc:6:24: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                        ^
Language: C++

#include <iostream>
using namespace std;

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



Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin <<a<<b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for (int i = 0; i < 2; i++) {
      | ^~~
a.cc:6:17: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                 ^
a.cc:6:24: error: 'i' does not name a type
    6 | for (int i = 0; i < 2; i++) {
      |                        ^
Language: C++

#include <iostream>
using namespace std;

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



Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin <<a<<b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for(int i=0;i<2;i++){
      | ^~~
a.cc:6:13: error: 'i' does not name a type
    6 | for(int i=0;i<2;i++){
      |             ^
a.cc:6:17: error: 'i' does not name a type
    6 | for(int i=0;i<2;i++){
      |                 ^
Language: C++

#include <iostream>
using namespace std;

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



Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >>a>>b;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for(i=0;i<2;i++){
      | ^~~
a.cc:6:9: error: 'i' does not name a type
    6 | for(i=0;i<2;i++){
      |         ^
a.cc:6:13: error: 'i' does not name a type
    6 | for(i=0;i<2;i++){
      |             ^
Language: C++

#include <iostream.h>
using namespace std;

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



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

#include <bit/stdc++.h>
#define ed cout<<"/n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main() {
  speed;
	int a,b;
	cin >> a >> b;
	int ans=0;
	for (int i = 0; i < 2; i++) {
		bool flug = false;
		if (a <= b&&!flug) {
			ans += b;
			b--;
			flug = true;
		}
		if (b < a&&!flug) {
			ans += a;
			a--;
			flug = true;
		}
	}
		cout << ans ;ed;
	return 0;
}


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

#include "bit/stdc++.h"
#define ed cout<<"/n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main() {
  speed;
	int a,b;
	cin >> a >> b;
	int ans=0;
	for (int i = 0; i < 2; i++) {
		bool flug = false;
		if (a <= b&&!flug) {
			ans += b;
			b--;
			flug = true;
		}
		if (b < a&&!flug) {
			ans += a;
			a--;
			flug = true;
		}
	}
		cout << ans ;ed;
	return 0;
}


Compiler output:
a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include "bit/stdc++.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "bit/stdc++.h"
#define ed cout<<"/n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main() {
	speed;
	string s;
	cin >> s;
	int ans=0;


	cout << ans; ed;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include "bit/stdc++.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<stdio.h>
int main(void){
    int a,b;
    scanf("%d%d",&a,&b);
    int y=0;

    for(i=0;i++;i<2){
        if(a<b){
            y+=b;
            b-=1;
        }else{
            y+=a;
            a-=1;
        }
    }
    printf("%d"y);
    return 0

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     for(i=0;i++;i<2){
      |         ^
a.cc:16:12: error: unable to find string literal operator 'operator""y' with 'const char [3]', 'long unsigned int' arguments
   16 |     printf("%d"y);
      |            ^~~~~
a.cc:17:13: error: expected ';' before '}' token
   17 |     return 0
      |             ^
      |             ;
   18 | 
   19 | }
      | ~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

      	if (A > B) {
          System.out.println(A * 2 - 1);
        else if (A == B) {
          System.out.println(A * 2);
        } else {
          System.out.println(B * 2 - 1);
        }
    }
}

Compiler output:
Main.java:11: error: 'else' without 'if'
        else if (A == B) {
        ^
Main.java:17: error: reached end of file while parsing
}
 ^
2 errors
Language: C++

A, B = map(int, input().split())
C = int()
if A > B:
    C = A*2 - 1
    print("{}".format(C))
elif A < B:
    C = B*2 - 1
    print("{}".format(C))
else :
    C = A*2
    print("{}".format(C))

Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A, B = map(int, input().split())
      | ^
Language: Java

import java.util.*;

public class main
{
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int a,b,sum=0;
		a = stdIn.nextInt();
		b = stdIn.nextInt();
		
		int A = Math.max(a,b);
		int B = Math.min(a,b);
		
		sum = Math.max(2*A-1,A+B);
		
		System.out.println(sum);
	}
}

Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main
       ^
1 error
Language: Java

import java.util.Scanner;

public class abc124a
{
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int a,b,sum=0;
		a = stdIn.nextInt();
		b = stdIn.nextInt();
		for(int i=0;i<2;i++)
		{
			if(a>b)
			{
				sum+=a;
				a--;
			}
			else
			{
				sum+=b;
				b--;
			}
		}
		
		System.out.println(sum);
	}
}

Compiler output:
Main.java:3: error: class abc124a is public, should be declared in a file named abc124a.java
public class abc124a
       ^
1 error
Language: Java

import java.util.Scanner;

public class abc124a
{
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int a,b;
		a = stdIn.nextInt();
		b = stdIn.nextInt();
		
		
		System.out.println(a+b);
	}
}

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

import java.util.Scanner;

public class abc124a
{
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		int a,b;
		a = stdIn.nextInt();
		b = stdIn.nextInt();
		
		
		System.out.println(a+b);
	}
}

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

#include<stdio.h>

int main(void){
  int a,b,c=0;
  scanf("%d %d",&a,&b);
  if(a>b) {
    c=a;
    a--;
  }
  else{
    c=b;
    b--;
  }
  if(a>=b) c=c+a;
  else c=c+a;
  printf("%d",c);
  return 0
}
      
  


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

#include<stdio.h>

int main(void){
  int a,b,c=0;
  scanf(%d %d,&a,&b);
  if(a>b) {
    c=a;
    a--;
  }
  else{
    c=b;
    b--;
  }
  if(a>=b) c=c+a;
  else c=c+a;
  printf(%d,c);
  return 0
}
      
  

Compiler output:
main.c: In function 'main':
main.c:5:9: error: expected expression before '%' token
    5 |   scanf(%d %d,&a,&b);
      |         ^
main.c:16:10: error: expected expression before '%' token
   16 |   printf(%d,c);
      |          ^
main.c:17:11: error: expected ';' before '}' token
   17 |   return 0
      |           ^
      |           ;
   18 | }
      | ~
Language: Java

import java.util.*;

public class Main {
        public static void main(String[] args){
            Scanner sc =new Scanner(System.in);
            int a = sc.nextInt();
            int b = sc.nextInt();
            int sum =0;
            for(int i=0;i<2;i++) {
                if (a > b) {
                    sum += a;
                    a--;
                } else {
                    sum += b;
                    b--;
                }
            }
            System.out.println(sum);
        }

        }
}


Compiler output:
Main.java:22: error: class, interface, enum, or record expected
}
^
1 error
Language: C++

#include <iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: expected '}' at end of input
   22 |     return 0;
      |              ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include "stdafx.h"
#include <iostream>
using namespace std;

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

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

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main(void){
    int N,K;
    cin>>N>>K;
    string S;
    cin>>S;
    int t,T,Q;
    int A[N+1];
    for(int i=1;i<N+1;i++){
        A[i]=0;
    }
 
    t=0;
    T=0;
    A[0]=1;
    for(int i=0;i<N-1;i++){
       if(S[i]==S[i+1]){ 
           A[t]=A[t]+1;
        }else{
            t=t+1;
            A[t]=A[t]+1;
        }
    }
      for(int i=0;i<N;i++){
    }
  
  
  
    if(S[0]=='0'){
        for(int i=N;i>=0;i--){
 
           A[i+1]=A[i];
        }
        A[0]=0;
    }
    
      for(int i=0;i<N-1;i++){
 
    }
    if(2*K+1>N){
        cout<<N<<endl;
        return 0;
    }
    if(S(0)=='1' && 2*K+1>=N){
        cout<<N<<endl;
        return 0;
    }
    
    for(int i=0;i<2*K+1;i++){
        T=T+A[i];
        Q=T;
    }
    
    for(int i=0;i<N+1;i=i+2){
        if(A[2*K+2+i]==0){
            break;
        }
        T=T-A[i]-A[i+1]+A[2*K+1+i]+A[2*K+2+i];
        Q=max(T,Q);
    }
        
    cout<<Q<<endl;
      
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   46 |     if(S(0)=='1' && 2*K+1>=N){
      |        ~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  short a,b,sum=0;
  cin>>a>>b;
  sum+=max(a,b);
  sum+=max(sum-1,min(a,b));
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: no matching function for call to 'max(int, const short int&)'
    7 |   sum+=max(sum-1,min(a,b));
      |        ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:7:11: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'short int')
    7 |   sum+=max(sum-1,min(a,b));
      |        ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:7:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    7 |   sum+=max(sum-1,min(a,b));
      |        ~~~^~~~~~~~~~~~~~~~
Language: C

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

	int A, B;

	do {
		scanf_s("%d%d", &A, &B);
	} while (A < 3 && A > 20 && B < 3 && B > 20);

	int get1, get2;

	if (A >= B) {
		get1 = A;
		A--;
	}
	else {
		get1 = B;
		B--;
	}
	if (A >= B) {
		get2 = A;
	}
	else {
		get2 = B;
	}
	printf("%d\n", get1 + get2);
	return 0;
}

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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B;
      |      ^~
      |      ;
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B;
      |      ^~
      |      ;
a.cc:14:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   14 |   cont <<A*2+1<<endl;
      |   ^~~~
      |   const
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if (A < B ){
      |   ^~
a.cc:12:3: error: expected unqualified-id before 'if'
   12 |   if (A == B ){
      |   ^~
a.cc:15:3: error: expected unqualified-id before 'if'
   15 |   if (A > B ){
      |   ^~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A>>B;
      |      ^~
      |      ;
a.cc: At global scope:
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else if (A < B) {
      | ^~~~
a.cc:13:1: error: expected unqualified-id before 'else'
   13 | else if (A > B) {
      | ^~~~
Language: C++

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

int main() {
  int A, B, X;
  cin >> A;  
  cin >> B;

  if (A < B ){
     X >> 2*B-1;

  if (A == B ){
     X >> 2*A;

  if (A > B ){
     X >> 2*A-1;
  cout << X << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:12:15: note: to match this '{'
   12 |   if (A == B ){
      |               ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:9:14: note: to match this '{'
    9 |   if (A < B ){
      |              ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int A, B, X;
  cin >> A;  
  cin >> B;

  if (A < B ){
     X >> 2*B-1

  if (A == B ){
     X >> 2*A

  if (A > B ){
     X >> 2*A-1
  cout << X << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'if'
   10 |      X >> 2*B-1
      |                ^
      |                ;
   11 | 
   12 |   if (A == B ){
      |   ~~            
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:9:14: note: to match this '{'
    9 |   if (A < B ){
      |              ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int name 
int a,b
cin >> a,b
if (a>b) name=a 
else name=b endl;
if (a>b) name+(a-1)
else name+(b-1) endl;





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

a,b = map(int, input().split())
if a > b:
	print(a + a - 1)
else:
	if a == b:
		print(a + b)
	else:
		print(b + b - 1)

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

#include <iostream>

using namespace std;

int main(){
  int A, B;
  cin >> A >> B;
  
  int N = max{A,B};
  
  cout << 2*N;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
    9 |   int N = max{A,B};
      |           ^~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int A, B;
  cin >> A >> B;
  
  cout << 2*max{A,B};
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator*'
    9 |   cout << 2*max{A,B};
      |           ~^~~~
Language: C

#include<stdio.h>
int main(void)
{
   int a,b,c,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\n",c);
   return 0;


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

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

Compiler output:
main.c: In function 'main':
main.c:6:25: error: expected identifier before '&' token
    6 |         scanf("%d%d",&a.&b);
      |                         ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:25: error: expected identifier before '&' token
    6 |         scanf("%d%d",&a.&b);
      |                         ^
Language: C

#include <stdio.h>
int main(void)
{
  	int a,b;
  	
  	scanf("%d%d",&a.&b);
  	
  	if((a-1)>b){
      	printf("%d",a+(a-1));
    }else if((a-1)<b){
		printf("%d",a+b);
    }else{
      	Printf("%d",a+a);
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:25: error: expected identifier before '&' token
    6 |         scanf("%d%d",&a.&b);
      |                         ^
main.c:13:9: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |         Printf("%d",a+a);
      |         ^~~~~~
      |         printf
Language: C++

int main(void){
	int A, B;
  	std::cin >> A >> B;
  	if( A-1 >= B) return 2*A - 1;
  	else if ( A <= B-1) return 2*B - 1;
  	else return 2*A;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin >> A >> B;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(void){
Language: C

#include <stdio.h>
#include <string.h>

int main(){
  string S; scanf("%s", &s);
  int length = strlen(S);
  /* int ans = sizeof(S); */
  int i, j;

  for(i = 0; i < 2; i++){
    int count = 0;
    for(j = 0; j < length; j++){
      if(j % 2 == 0 && S[j] != (char)(i + '0')) count++;
      if(j % 2 == 1 && S[j] == (char)(i + '0')) count++;
    }
  }

  printf("%d\n", count);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: unknown type name 'string'; did you mean 'stdin'?
    5 |   string S; scanf("%s", &s);
      |   ^~~~~~
      |   stdin
main.c:5:26: error: 's' undeclared (first use in this function)
    5 |   string S; scanf("%s", &s);
      |                          ^
main.c:5:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:23: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    6 |   int length = strlen(S);
      |                       ^
      |                       |
      |                       int
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:13:25: error: subscripted value is neither array nor pointer nor vector
   13 |       if(j % 2 == 0 && S[j] != (char)(i + '0')) count++;
      |                         ^
main.c:14:25: error: subscripted value is neither array nor pointer nor vector
   14 |       if(j % 2 == 1 && S[j] == (char)(i + '0')) count++;
      |                         ^
main.c:18:18: error: 'count' undeclared (first use in this function)
   18 |   printf("%d\n", count);
      |                  ^~~~~
Language: C

#include <stdio.h>
int main()
{
  int N,H,A;
  scanf("%d",N);
  while(0<N)
  {
    scanf("%d",H);
    N--;
  if(H>=H)
  {
    A+=1;
    printf("%d",A);
  }
    return 0;
  }
  

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

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

int main(){
  string s;
  cin >> s;
  
  vector<char> restr1(s.size(),'1');
  for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr.at(i) == '0';
  vector<char> restr0(s.size(),'0');
  for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr.at(i) == '1';
  
  
  int ans0 = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != restr0.at(i))ans0++;
  }
  
  int ans1 = 0;
  for(int i = 0; i < s.size(); i++){
    if(s.at(i) != restr1.at(i))ans1++;
  }
  
  cout << min(ans0, ans1) << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:53: error: 'restr' was not declared in this scope; did you mean 'restr1'?
    9 |   for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr.at(i) == '0';
      |                                                     ^~~~~
      |                                                     restr1
a.cc:11:53: error: 'restr' was not declared in this scope; did you mean 'restr0'?
   11 |   for ( int i = 0; i < s.size();i++)if (i % 2 == 1) restr.at(i) == '1';
      |                                                     ^~~~~
      |                                                     restr0
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:18: error: invalid operands to binary & (have 'int *' and 'int')
    6 |   scanf("%d%d",&A&B);
      |                ~~^
      |                |
      |                int *
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:18: error: invalid operands to binary & (have 'int *' and 'int')
    6 |   scanf("%d%d",&A&B);
      |                ~~^
      |                |
      |                int *
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:18: error: invalid operands to binary & (have 'int *' and 'int')
    6 |   scanf("%d%d",&A&B);
      |                ~~^
      |                |
      |                int *
Language: C++

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


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

li=list(map(int,input().split()))

a=li[0]
b=li[1]

ans=0

if(a>=b):
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if(a>=b):
    ans+=a
    a-=1
else:
    ans+=b
    b-=1


print(ans)

Compiler output:
a.cc:1:1: error: 'li' does not name a type
    1 | li=list(map(int,input().split()))
      | ^~
Language: C++

a=int(input())
b=int(input())

ans=0

if(a>=b):
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if(a>=b):
    ans+=a
    a-=1
else:
    ans+=b
    b-=1


print(a+b)

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

    import java.util.Scanner;
     
     
    public class B{
     
    	public static void main(String[] args) {
    		Scanner sc = new Scanner(System.in);
     
    		int n=Integer.parseInt(sc.next());
            int count=0;
            int max=0;

            for(int i=0; i<n; i++) {
                int h = sc.nextInt();
                if(h >= max) {
                    count++;
                    max = h;
                }
            }


            System.out.println(count);
    	}
     
    }


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

#include <iostream>
using namespace std;

int main(){
	int a,b;
  cin >> a >> b;
  cout << max(a,b) * 2- (a != b) << endl;
  return 0:
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before ':' token
    8 |   return 0:
      |           ^
      |           ;
a.cc:8:11: error: expected primary-expression before ':' token
Language: Java

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









Compiler output:
Main.java:14: error: ';' expected
        b -= 1
              ^
1 error
Language: Java

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







Compiler output:
Main.java:8: error: cannot find symbol
    for(i=0;i<2;i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i=0;i<2;i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i=0;i<2;i++){
                ^
  symbol:   variable i
  location: class Main
3 errors
Language: Java

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






Compiler output:
Main.java:16: error: reached end of file while parsing
}
 ^
1 error
Language: C

#include<stdio.h>

int main()
{
	int main () {
		int A , B ; 
		int ans ;
      	scanf("%d",A);
      	scanf("%d",B);
		if ( A > B ) {
			ans = A + (A -1);
        } else if (B > A )　{
			ans = B + (B -1);
		} else {
			ans = A + B ;
		}
		return 0;
	}
}

Compiler output:
main.c: In function 'main':
main.c:12:27: error: stray '\343' in program
   12 |         } else if (B > A )<U+3000>{
      |                           ^~~~~~~~
Language: C

#include<stdio.h>

int main()
{
	int main () {
		int A , B ; 
		int ans ;
		if ( A > B ) {
			ans = A + (A -1);
        } else if (B > A )　{
			ans = B + (B -1);
		} else {
			ans = A + B ;
		}
		return 0;
	}
}

Compiler output:
main.c: In function 'main':
main.c:10:27: error: stray '\343' in program
   10 |         } else if (B > A )<U+3000>{
      |                           ^~~~~~~~
Language: C

#include<stdio.h>

int main()
{
	int main () {
		int A , B ; 
		int ans ;
		if ( A > B ) {
			ans = A + (A -1);
		}else if (B > A )　{
			ans = B + (B -1);
		}else {
			ans = A + B ;
		}
		return 0;
	}
}

Compiler output:
main.c: In function 'main':
main.c:10:34: error: stray '\343' in program
   10 |                 }else if (B > A )<U+3000>{
      |                                  ^~~~~~~~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:29: error: 'cin' undeclared (first use in this function)
    6 |                 int A , B ; cin >> A >> B ;
      |                             ^~~
main.c:6:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:34: error: stray '\343' in program
   10 |                 }else if (B > A )<U+3000>{
      |                                  ^~~~~~~~
main.c:15:17: error: 'cout' undeclared (first use in this function)
   15 |                 cout << ans << endl ;
      |                 ^~~~
main.c:15:32: error: 'endl' undeclared (first use in this function)
   15 |                 cout << ans << endl ;
      |                                ^~~~
Language: C++

// キョウプロ.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#pragma once

#include "stdafx.h"
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long A, B, C, D, M, N, X, Y, Z;


int main()
{

	cin >> A >> B;

	if (A == B) {
		C = A + B;
	}
	else {
		C = max(A, B) * 2 - 1;
	}

	cout << C << endl;

    return 0;
}



Compiler output:
a.cc:4:9: warning: #pragma once in main file
    4 | #pragma once
      |         ^~~~
a.cc:6:10: fatal error: stdafx.h: No such file or directory
    6 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

// キョウプロ.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

//#pragma once

#include "stdafx.h"
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long A, B, C, D, M, N, X, Y, Z;


int main()
{

	cin >> A >> B;

	if (A == B) {
		C = A + B;
	}
	else {
		C = max(A, B) * 2 - 1;
	}

	cout << C << endl;

    return 0;
}



Compiler output:
a.cc:6:10: fatal error: stdafx.h: No such file or directory
    6 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

// キョウプロ.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long A, B, C, D, M, N, X, Y, Z;


int main()
{

	cin >> A >> B;

	if (A == B) {
		C = A + B;
	}
	else {
		C=max(A,B)*2-1:
	}

	cout << C << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:31: error: expected ';' before ':' token
   29 |                 C=max(A,B)*2-1:
      |                               ^
      |                               ;
Language: C

include <stdio.h>

int main(void){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
int i;
int sum=0;
for(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:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

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


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

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

int main() {
  int A, B;
  cin >> A >> B;
  
  int total = 0;
  
  if (A>B){
    total = A*2-1;
  }
  if else (A<B){
    total = B*2-1;
  }
  else {
    total = A*2; 
  }

 cout << total <<endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:6: error: expected '(' before 'else'
   13 |   if else (A<B){
      |      ^~~~
      |      (
a.cc:16:3: error: 'else' without a previous 'if'
   16 |   else {
      |   ^~~~