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

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

int main() {
  int n, m;
  cin >> n >> m;
  if(b % a == 0) {
    cout << a + b << endl;
  } else {
    cout << b - a << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'b' was not declared in this scope
    7 |   if(b % a == 0) {
      |      ^
a.cc:7:10: error: 'a' was not declared in this scope
    7 |   if(b % a == 0) {
      |          ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: lvalue required as left operand of assignment
   11 |   if(b%a=0){
      |      ~^~
Language: C++

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

int main() {
  int A.B;
  cin >>A>>B;
  if(B%A==0){
    cout<<A+B<<endl;
  }
  else{
    cout<<B-A<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 |   int A.B;
      |        ^
a.cc:6:9: error: 'A' was not declared in this scope
    6 |   cin >>A>>B;
      |         ^
a.cc:6:12: error: 'B' was not declared in this scope
    6 |   cin >>A>>B;
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'if'
    7 |   if(B%A==0){
      |   ^~
a.cc:9:4: error: 'else' without a previous 'if'
    9 |   }else{
      |    ^~~~
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans = B-A;
      |     ^~~
      |     abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B ;
      |      ^~
      |      ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B >>;
      |      ^~
      |      ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B >>;
      |      ^~
      |      ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A >> B>>;
      |      ^~
      |      ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'A'
    6 |   cin A>> B>>;
      |      ^~
      |      ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double t,x;
  cin >>t>>x;
  if(x%t==0){cout<<t+x<<endl;}
  else{cout<<x-t<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    7 |   if(x%t==0){cout<<t+x<<endl;}
      |      ~^~
      |      | |
      |      | double
      |      double
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: lvalue required as left operand of assignment
    7 |   if(B%A=0)cout<<A+B<<endl;
      |      ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin >> a >> b;
  cout << (b % a == 0 ? a + b : b - a)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: error: expected ';' before '}' token
    7 |   cout << (b % a == 0 ? a + b : b - a)
      |                                       ^
      |                                       ;
    8 | }
      | ~
Language: C++

#include "bits/stdc++.h"
template <class T = int> T in() { T n; cin >> n; return n; }

int main() {
	int a = in(), b = in();
	cout << (b % a ? b - a : a + b) << endl;
}

Compiler output:
a.cc: In function 'T in()':
a.cc:2:40: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | template <class T = int> T in() { T n; cin >> n; return n; }
      |                                        ^~~
      |                                        std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout << (b % a ? b - a : a + b) << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:44: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         cout << (b % a ? b - a : a + b) << endl;
      |                                            ^~~~
      |                                            std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
	int A + B;
  	cin >> A >> B;
  
  	if(B % A == 0) {
    	cout << A + B << endl;
    }else {
    	cout << A - B << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: expected initializer before '+' token
    5 |         int A + B;
      |               ^
a.cc:6:16: error: 'A' was not declared in this scope
    6 |         cin >> A >> B;
      |                ^
a.cc:6:21: error: 'B' was not declared in this scope
    6 |         cin >> A >> B;
      |                     ^
Language: C++

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

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


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

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        if (B % A == 0) System.out.println(A + B);
        else System.out.println(B - A);
    }
}


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

#include <bits/stdc++.h>
using naespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if(b%a==0){
    cout<<a+b<<endl;
  }
  else
    cout<<b-a<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'naespace'
    2 | using naespace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a>>b;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout<<a+b<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout<<a+b<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout<<b-a<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout<<b-a<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int a,b;
  cin >> a;
  cin >> b;
  if(b % a == 0) 
  {
    cout << a + b << endl;
  } else {
    cout << b - a << endl;
  }
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before '}' token
   14 |   return 0
      |           ^
      |           ;
   15 | }
      | ~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int a,b;
  cin >> a;
  cin >> b;
  if(b % a == 0) 
  {
    return a + b;
  } else {
    return b - a:
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: expected ';' before ':' token
   12 |     return b - a:
      |                 ^
      |                 ;
a.cc:12:17: error: expected primary-expression before ':' token
Language: C

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

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

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

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

    if (b % a = 0){
        cout << a + b << endl;
    }
    else {
        cout << b - a << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: lvalue required as left operand of assignment
    8 |     if (b % a = 0){
      |         ~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
  int A,B;
  cin >> A >> B; 

  if(B % A==0){
  cout << A+B <<endl;
  }
  else{
  cout << B-A << endl;
  }


}


Compiler output:
a.cc:4:3: error: 'cin' does not name a type
    4 |   cin >> A >> B;
      |   ^~~
a.cc:6:3: error: expected unqualified-id before 'if'
    6 |   if(B % A==0){
      |   ^~
a.cc:9:3: error: expected unqualified-id before 'else'
    9 |   else{
      |   ^~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

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

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

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

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

int main() {
  int a, b, i, check = 0;
  cin >> a >> b;
  
  for(i = 1; i < b; i++){
    if(i * a == b){
      cout << a + b << endl;
      check ++
      break;
    }
  }
  
  if(check >= 1){
    cout << b - a << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected ';' before 'break'
   11 |       check ++
      |               ^
      |               ;
   12 |       break;
      |       ~~~~~
Language: C++

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

int main()
{
  int A;
  int B;
  cin>>A>>B;
  if (B/A==(B+0.0)/A){
    cout<< A+B <<endl;
  } else {
    cout<< A-b <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'b' was not declared in this scope
   13 |     cout<< A-b <<endl;
      |              ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: lvalue required as left operand of assignment
    7 |   if (B%A=0) {
      |       ~^~
Language: Java

import java.util.Scanner;
public class Main {
  public static void main (String[]args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();

    for(int i = 1;;i++){
      int j = A*i;
      if(j == B){
        System.out.println(A+B);
        break;
      } 
      if(j>B) {
        System.out.println(B-A);
        break;
      }      

  }
}


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

#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())

#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
#define Dev 1000000007

// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   21 |     if(b%a==0)
      |        ~^~
      |        | |
      |        | double
      |        double
Language: C++

#include<iostream>
using namespace std;
int maint(){
  int a,b;
  cin>>a>>b;
  if(b%a==0){
    cout<<a+b;
  }else{
    cout<<a-b;
  }
  return 0;
}

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

#include<iostream>
using namespace std;
int maint(){
  int a,b;
  cin>>A>>B;
  if(B%A==0){
    cout<<a+b;
  }else{
    cout<<a-b;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int maint()':
a.cc:5:8: error: 'A' was not declared in this scope
    5 |   cin>>A>>B;
      |        ^
a.cc:5:11: error: 'B' was not declared in this scope
    5 |   cin>>A>>B;
      |           ^
Language: C++

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

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;
      |               ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int GCD(int a, int b){
 	return (min(a, b) == 0 ? max(a, b) : GCD(max(a, b)%min(a,b), min(a, b)));
}

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

    int A;
    for(int i = 1; i <= N; i++) {
        int H;
        cin >> H;
        A_gcd = (i == 1 ? H : GCD(A_gcd, H));
    }

    cout << A_gcd;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'A_gcd' was not declared in this scope
   18 |         A_gcd = (i == 1 ? H : GCD(A_gcd, H));
      |         ^~~~~
a.cc:21:13: error: 'A_gcd' was not declared in this scope
   21 |     cout << A_gcd;
      |             ^~~~~
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (b % a == 0)
            System.out.println(B + A);
        else
            System.out.println(B - A);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
            System.out.println(B + A);
                               ^
  symbol:   variable B
  location: class Main
Main.java:9: error: cannot find symbol
            System.out.println(B + A);
                                   ^
  symbol:   variable A
  location: class Main
Main.java:11: error: cannot find symbol
            System.out.println(B - A);
                               ^
  symbol:   variable B
  location: class Main
Main.java:11: error: cannot find symbol
            System.out.println(B - A);
                                   ^
  symbol:   variable A
  location: class Main
4 errors
Language: C

#include <stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(a%b==0) printf("%d",a+b);
else if(a%b!=0) print("%d",a-b);

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 | else if(a%b!=0) print("%d",a-b);
      |                 ^~~~~
      |                 printf
Language: C++

#include <iostream>

int main(){
int a=0;
  int b=0;
  
  std::cin>>a>>b;
  if(b%a==0){
  std::cout<<a+b
  }else{
  std::cout<<b-a
  }
return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 |   std::cout<<a+b
      |                 ^
      |                 ;
   10 |   }else{
      |   ~              
a.cc:11:17: error: expected ';' before '}' token
   11 |   std::cout<<b-a
      |                 ^
      |                 ;
   12 |   }
      |   ~
Language: C++

def math(A,B):
    if A%B ==0:
        print(A+B)
    else:
        print(B-A)
A,B = tuple(map(int, input().split()))

math(A,B)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def math(A,B):
      | ^~~
Language: Java

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		if(B%A == 0) System.out.println(A + B);
		else System.out.println(B - A);
		
	}
}


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

    public static void main(String[] args) {
        String[] tData = args[0].split(" ",0);
        int tA = Integer.parseInt(tData[0]);
        int tB = Integer.parseInt(tData[1]);

        System.out.println(tB % tA == 0 ? tA + tB : tB - tA);
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args) {
                  ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include <cstdio>

int main() {
  scanf(" %d%d", &A, &B);
  printf("%d\n", ((B % A) == 0) ? (A+B) : (B-A));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: 'A' was not declared in this scope
    4 |   scanf(" %d%d", &A, &B);
      |                   ^
a.cc:4:23: error: 'B' was not declared in this scope
    4 |   scanf(" %d%d", &A, &B);
      |                       ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int A, B;

	cin >> A >> B;

	if (B % A == 0)
		cout << A + B;
	else
		cout << B - A;

	return 0;

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

#include <iostream>
#include <bits/stdc++.h>
typedef long long ll;
typedef pair<int,int> P;
#define F first
#define S second
#define PB push_back
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    bool o=false;
    for(int i=2;i<=max(a,b);i++)if(a%i==0&&b%i==0)o=true;
    if(o)cout<<a+b<<endl;
    else cout<<b-a<<endl;
    
}


Compiler output:
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,int> P;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 int main(){
   intA,B;
   cin>>A>>B;
   if (B%A==0)
     cout<<A+B<<endl;
   else 
     cout<<B-A<<endl;
   return 0;
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:4: error: 'intA' was not declared in this scope; did you mean 'int'?
    4 |    intA,B;
      |    ^~~~
      |    int
a.cc:4:9: error: 'B' was not declared in this scope
    4 |    intA,B;
      |         ^
a.cc:5:9: error: 'A' was not declared in this scope
    5 |    cin>>A>>B;
      |         ^
Language: C++

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

    if (A == 0)
        cout<<B - A<<endl;
    else
    {
        if (B % A == 0)
            cout<<A + B<<endl;
        else   
            cout<<B - A<<endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>A;
      |     ^~~
a.cc:8:9: error: 'cout' was not declared in this scope
    8 |         cout<<B - A<<endl;
      |         ^~~~
a.cc:8:22: error: 'endl' was not declared in this scope
    8 |         cout<<B - A<<endl;
      |                      ^~~~
a.cc:12:13: error: 'cout' was not declared in this scope
   12 |             cout<<A + B<<endl;
      |             ^~~~
a.cc:12:26: error: 'endl' was not declared in this scope
   12 |             cout<<A + B<<endl;
      |                          ^~~~
a.cc:14:13: error: 'cout' was not declared in this scope
   14 |             cout<<B - A<<endl;
      |             ^~~~
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |             cout<<B - A<<endl;
      |                          ^~~~
Language: C++

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

int main(){
      
      int A;
      int B;
      
      cin >> A >> B;
      
      if(B%A == 0){
        cout <<A+B<< endl;
      }
      else{
        cout <<B-A <<endl;
      }
    }

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

      int A;
      int B;
      
      cin << A << B;
      
      if(B%A == 0){
        cout <<A+B;
      }
      else{
        cout <<B-A;
      }


Compiler output:
a.cc:4:7: error: 'cin' does not name a type
    4 |       cin << A << B;
      |       ^~~
a.cc:6:7: error: expected unqualified-id before 'if'
    6 |       if(B%A == 0){
      |       ^~
a.cc:9:7: error: expected unqualified-id before 'else'
    9 |       else{
      |       ^~~~
Language: C++

	int main(){
      
      int A;
      int B;
      
      cin << A << B;
      
      if(B%A == 0){
        cout <<A+B;
      }
      else{
        cout <<B-A;
      }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'cin' was not declared in this scope
    6 |       cin << A << B;
      |       ^~~
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout <<A+B;
      |         ^~~~
a.cc:12:9: error: 'cout' was not declared in this scope
   12 |         cout <<B-A;
      |         ^~~~
Language: C++

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

	int main(){
      
      int A;
      int B;
      
      cin << A << B;
      
      if(B%A == 0){
        cout <<A+B;
      }
      else{
        cout <<B-A;
      }
    }

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

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:12:21: error: expected ';' before 'return'
   12 |     printf("%d",b-a)
      |                     ^
      |                     ;
......
   15 | return 0;
      | ~~~~~~
Language: C++

#include<bits/stdc++.h>
2.using namespace std;
3.int main(){
4.int A,B;
5.cin>>A>>B;
6.if (B%A==0) cout<<A+B;
7.  else cout<<B-A;
8.}


Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.using namespace std;
      | ^~~~~~~
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3.int main(){
      | ^~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: lvalue required as left operand of assignment
    6 | if (B%A=0) cout<<A+B;
      |     ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: lvalue required as left operand of assignment
    7 |   cout << B-A+(B%A=0)*2*A<<endl;
      |                ~^~
Language: Java

import java.util.Scanner;

public class atCoder{
  public static void main(){
    Scanner scan = new Scanner(System.in);
    String strA = scan.next();
    String strB = scan.next();
    int intA = Integer.parseInt(strA);
    int intB = Integer.parseInt(strB);
    if (intB%intA == 0){
    	System.out.println(intA+intB);

    }else{

    	System.out.println(intB - intA);
  }
}
  }

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

public class Main{
  public static void main(){
    Scanner scan = new Scanner(System.in);
    String strA = scan.next();
    String strB = scan.next();
    int intA = Integer.parseInt(strA);
    int intB = Integer.parseInt(strB);
    if (intB%intA = 0){
      Sistem.out.println(intA+intB);
    }else{
      Sistem.out.println(intB-intA);
  }
}

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

import java.util.*;
public class Main {
	    public static void main(String[] args) throws Exception {
	        
	        @SuppressWarnings("resource")
			Scanner scanner = new Scanner(System.in);
	        int A = scanner.nextInt();
	        int B = scanner.nextInt();
	        System.out.println(B % A == 0?A+B:B-A);
	    }
	}

Compiler output:
a.cc:5:17: error: stray '@' in program
    5 |                 @SuppressWarnings("resource")
      |                 ^
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: Java

import java.util.*;
public class BtoA {
	    public static void main(String[] args) throws Exception {
	        
	        @SuppressWarnings("resource")
			Scanner scanner = new Scanner(System.in);
	        int A = scanner.nextInt();
	        int B = scanner.nextInt();
	        System.out.println(B % A == 0?A+B:B-A);
	    }
	}

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

import java.util.Scanner;

public class Main{
	public static void main(){
		int a;
		int b;
		int c=0;
		Scanner sc = new Scanner(System.in);
		a = sc.nextInt();
		b = sc.nextInt();

		if(b%a==0){
			c=a+b;
		} else {
			c=b-a;
		}

		System.out.println(c);
		return 0;

	}
}


Compiler output:
Main.java:19: error: incompatible types: unexpected return value
		return 0;
		       ^
1 error
Language: Java

public class Main{
	public static void main(){
		int a;
		int b;
		int c=0;
		Scanner sc = new Scanner(System.in);
		a = sc.nextInt();
		b = sc.nextInt();

		if(b%a==0){
			c=a+b;
		} else {
			c=b-a;
		}

		System.out.println(c);
		return 0;

	}
}


Compiler output:
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:17: error: incompatible types: unexpected return value
		return 0;
		       ^
3 errors
Language: Java

package kc;

import java.util.*;
public class BtoA {
	    public static void main(String[] args) throws Exception {
	        
	        @SuppressWarnings("resource")
			Scanner scanner = new Scanner(System.in);
	        int A = scanner.nextInt();
	        int B = scanner.nextInt();
	        System.out.println(B % A == 0?A+B:B-A);
	    }
	}

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

# include <bits/stdc++.h>
using namespace std ;
int main () {
  int i,j,n,m,s=0,k;
  cin >> n;
  cin >> m;
  int a[m];
  for(i=0;i<m;i++){
    a[i] = 0;
  }
  for(i=0;i<n;i++){
    cin >> k;
    for(j=0;j<k;j++){
      cin >> a[j] += 1;
    }
  }
  for(i=0;i<n;i++){
    if(a[i]==n){s++;}
  }
      
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: no match for 'operator+=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
   14 |       cin >> a[j] += 1;
      |       ~~~~~~~~~~~~^~~~
Language: C++

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

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

# include <bits/stdc++.h>
using namespace std ;
int main () {
  cin << int a << int b ;
  if( b % a == 0 ){
    cout >> a + b >> endl;
  }else{
    cout >> b - a >> endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   cin << int a << int b ;
      |          ^~~
a.cc:5:7: error: 'b' was not declared in this scope
    5 |   if( b % a == 0 ){
      |       ^
a.cc:5:11: error: 'a' was not declared in this scope
    5 |   if( b % a == 0 ){
      |           ^
Language: C++

# include < bits / stdc ++. h >
using namespace std ;
int main () {
  cin << int a << int b ;
  if( b % a == 0 ){
    cout >> a + b >> endl;
  }else{
    cout >> b - a >> endl;
  }
  return 0;
}

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

    #include<iostream>
    using namespace std;
    int main()
    {
        int numa,numb;
      cin >> numa;
      cin >> numb;
      if(numb%numa){
        cout <<numa+numb;
       else{
         cout << numb-numa;
       }
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected '}' before 'else'
   10 |        else{
      |        ^~~~
a.cc:8:20: note: to match this '{'
    8 |       if(numb%numa){
      |                    ^
Language: C++

#include<iostream>
#include <string>
#include <cstdlib> //絶対値利用のため
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

//const int INF = INT_MAX / 2;

int main() {
	int n, m;
	cin >> n >> m;
	int a[10];
	int h[] = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a, a + m, greater<int>());
	int dp[10100];
	fill(dp, dp + 10100, -1);
	dp[0] = 0;
	for (int i = 0; i <= n; i++) {
		if (dp[i] == -1) continue;
		for (int j = 0; j < m; j++) {
			dp[i + h[a[j]]] = max(dp[i + h[a[j]]], dp[i] + 1);
		}
	}
	int k = n;
	while (k) {
		for (int i = 0; i < m; i++)
			if (k - h[a[j]] >= 0 && dp[k - h[a[i]]] == (dp[k] - 1)) {
				cout << a[i];
				k = k - h[a[i]];
				break;
			}

	}
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:37: error: 'j' was not declared in this scope
   34 |                         if (k - h[a[j]] >= 0 && dp[k - h[a[i]]] == (dp[k] - 1)) {
      |                                     ^
Language: C++

#include<ios>
int a,b;main(){std::cin>>a>>b;std::cout<<(b%a?b-a:a+b);}


Compiler output:
a.cc:2:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a,b;main(){std::cin>>a>>b;std::cout<<(b%a?b-a:a+b);}
      |         ^~~~
a.cc: In function 'int main()':
a.cc:2:21: error: 'cin' is not a member of 'std'
    2 | int a,b;main(){std::cin>>a>>b;std::cout<<(b%a?b-a:a+b);}
      |                     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<ios>
  +++ |+#include <iostream>
    2 | int a,b;main(){std::cin>>a>>b;std::cout<<(b%a?b-a:a+b);}
a.cc:2:36: error: 'cout' is not a member of 'std'
    2 | int a,b;main(){std::cin>>a>>b;std::cout<<(b%a?b-a:a+b);}
      |                                    ^~~~
a.cc:2:36: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include <iostream>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	if (b%a==0)  cout<<a+b<<endl;
	else cout<<b-a<<endl;
	return 0;
}

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

#include<iostream>
 using namespace std;

int main(){
  int A, B;
  cin >> A >> B;
  
  if(B % A == 0) cout << A + B;
  else cout B - A;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'B'
    9 |   else cout B - A;
      |            ^~
      |            ;
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: lvalue required as left operand of assignment
    8 |   if(B % A = 0) {
      |      ~~^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before 'if'
    7 |   cin >> A >> B
      |                ^
      |                ;
    8 | 
    9 |   if(A % B = 0) {
      |   ~~            
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else {
      |   ^~~~
Language: C++

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

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> cnt(M,0)
    for(int i = 0; i < N; i++){
        int K; cin >> K;
        for(int j = 0; j<K ; j++){
           int A; cin >> A; A--;
           cnt(A)++;
        }
        }
    
    int ans = 0;
    for(int i = 0; i<M ; i++){
        if(cnt[i] == N){
            ans++;
        }
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'for'
    8 |     for(int i = 0; i < N; i++){
      |     ^~~
a.cc:8:20: error: 'i' was not declared in this scope
    8 |     for(int i = 0; i < N; i++){
      |                    ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'else' without a previous 'if'
    7 |     else if(B%A == 0){
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected primary-expression before '}' token
   12 |     }
      |     ^
Language: C

#include<stdio.h>

int
main(int argc, char *argv[])
{
	unsigned int A,B; 
	1<=A<=B<=20
	if(A%B==0){
	printf("%d\n",A+B);    
    }else{
     printf("%d\n",B-A) 
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:20: error: expected ';' before 'if'
    7 |         1<=A<=B<=20
      |                    ^
      |                    ;
    8 |         if(A%B==0){
      |         ~~
Language: C++

#include <iostream>
using namespace;
int main()
{
  int a,b;
  cin >> a >> b;
  if (b%a==0)
    cout << ( a+b );
  else
    cout << ( b-a );
  return 0;
}

Compiler output:
a.cc:2:16: error: expected identifier before ';' token
    2 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> a >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout << ( a+b );
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout << ( b-a );
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>a;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if(b%a)cout<<a+b;
      |          ^~~~
      |          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   else cout<<b-a;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

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

Compiler output:
Main.java:7: error: cannot find symbol
			int X =n;
			       ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.*;

class Main {
    public static int canDivide(int a, int b) {
      return (b % a == 0) ? a + b : b - a;
    }
	public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      
      String line = scanner.nextLine();
      String values = line.split(" ", 0);
      
      int a = values[0];
      int b = values[1];
      
      System.out.println(canDivide(a, b));
    }
}


Compiler output:
Main.java:11: error: incompatible types: String[] cannot be converted to String
      String values = line.split(" ", 0);
                                ^
Main.java:13: error: array required, but String found
      int a = values[0];
                    ^
Main.java:14: error: array required, but String found
      int b = values[1];
                    ^
3 errors
Language: Java

class Main {
    public static int canDivide(int a, int b) {
      return (b % a == 0) ? a + b / b - a;
    }
	public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);
      
      String line = scanner.nextLine();
      String values = line.split(" ", 0);
      
      int a = values[0];
      int b = values[1];
      
      System.out.println(canDivide(a, b));
    }
}

Compiler output:
Main.java:3: error: : expected
      return (b % a == 0) ? a + b / b - a;
                                         ^
1 error
Language: C++

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

int main() {
  int A, B;
  string op;
  cin >> A >> B;
   if (B % A == 0 ) {
    cout << A + B << endl;
  }
  }
 else {
    cout << B - A << endl;
  }
}


Compiler output:
a.cc:12:2: error: expected unqualified-id before 'else'
   12 |  else {
      |  ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

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

int main() {
  int A, B;
  string op;
  cin >> A >> op >> B;

  if (A % B = 0 ) {
  if (op == "+") {
    cout << A + B << endl;
  }
  }
 else {
    cout << B - A << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: lvalue required as left operand of assignment
    9 |   if (A % B = 0 ) {
      |       ~~^~~
Language: Java

public class Main{
  public static void main(String[] args){
    Scanner key = new Scanner(System.in);
    int A = key.nextInt();
    int B = key.nextInt();
    System.out.println((B%A==0) ? (A+B) : (B-A));
  }
}

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

class AtCoder(){
  public static void main(String[] args){
    int A,B;
    if(B % A == 0){
      System.out.println(A + B)
    else{
      System.out.println(B - A)
    }
}


Compiler output:
Main.java:1: error: '{' expected
class AtCoder(){
             ^
Main.java:5: error: ';' expected
      System.out.println(A + B)
                               ^
Main.java:7: error: ';' expected
      System.out.println(B - A)
                               ^
Main.java:6: error: 'else' without 'if'
    else{
    ^
Main.java:9: error: reached end of file while parsing
}
 ^
5 errors
Language: C++

    #inlude <cstdio>
     
    int main() 
    {
      int a, b;
      std::scanf("%d %d", &a, &b);
      
      if (b % a == 0){
        std::printf("%d\n", a + b);
      }
      else {
            std::printf("%d\n", b-a);
      }
    	return 0;
    }

Compiler output:
a.cc:1:6: error: invalid preprocessing directive #inlude; did you mean #include?
    1 |     #inlude <cstdio>
      |      ^~~~~~
      |      include
a.cc: In function 'int main()':
a.cc:6:12: error: 'scanf' is not a member of 'std'
    6 |       std::scanf("%d %d", &a, &b);
      |            ^~~~~
a.cc:9:14: error: 'printf' is not a member of 'std'
    9 |         std::printf("%d\n", a + b);
      |              ^~~~~~
a.cc:12:18: error: 'printf' is not a member of 'std'
   12 |             std::printf("%d\n", b-a);
      |                  ^~~~~~
Language: C++

#inlude <cstdio>

int main() 
{
  int a, b;
  std::scanf("%d %d", &a, &b);
  
  if (b % a == 0){
    printf("%d\n", a + b);
  }
  else {
        printf("%d\n", b-a);
  }
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude <cstdio>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:8: error: 'scanf' is not a member of 'std'
    6 |   std::scanf("%d %d", &a, &b);
      |        ^~~~~
a.cc:9:5: error: 'printf' was not declared in this scope
    9 |     printf("%d\n", a + b);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inlude <cstdio>
a.cc:12:9: error: 'printf' was not declared in this scope
   12 |         printf("%d\n", b-a);
      |         ^~~~~~
a.cc:12:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: Java

import java.util.Scanner;

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

        final boolean isDivisor = B % A == 0;
        if (isDivisor){
            output(A+B);
        }else{
            output(B-A);
        }
    }

    private static void output(int i) {
        System.out.println(i);
    }
}
}


Compiler output:
Main.java:5: error: illegal start of expression
    public static void main(String[] args) {
    ^
Main.java:22: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		// Input Example:
		//
		// N M
		// K1 A11 A12 ... A1k1
		// K2 A21 A22 ... A2k2
		// .
		// .
		// .
		// KN AN1 AN2 ... ANkN

		Scanner sc = new Scanner(System.in);
		// N people
		int N = sc.nextInt();
		
		// get two integers separated with half-width break
		// M kinds of foods
		int M = sc.nextInt(); 

		// Ki: the number of foods that No.i+1 person like
		int K;

		// map[M]: the table of the likeness of each foods 
		Map<Integer, Integer> map = new HashMap<Integer, Integer>();

		for (int i=0; i<N; i++)
		{
			K = sc.nextInt();
			for (int j=0; j<K; j++)
			{
				int K_temp = sc.nextInt();
				if (map.containsKey(K_temp))
				{
					int val = map.get(K_temp); // food no. K_temp +1
					val++;
					map.put(K_temp, val);
				}
				else
				{
					map.put(K_temp, 1);
				}
			}
		}
		sc.close();

		int ans = 0;
		for (int i=1;i<map.values();i++)
		{
			if (map.get(i) == N) //it means everyone (N people) likes it
			{
				ans++;
			}
		}
		System.out.println(ans);
		
	}

}

Compiler output:
Main.java:50: error: bad operand types for binary operator '<'
		for (int i=1;i<map.values();i++)
		              ^
  first type:  int
  second type: Collection<Integer>
1 error