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

#include <iostream>
using namespace std;

int main()
{
int a,b,c;

cin >> a >> b;

c=a+b;

if(c%24=!0){
  c=c-24;
  }

cout << c <, endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: lvalue required as left operand of assignment
   12 | if(c%24=!0){
      |    ~^~~
a.cc:16:12: error: expected primary-expression before ',' token
   16 | cout << c <, endl;
      |            ^
Language: C

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

}

Compiler output:
main.c: In function 'main':
main.c:10:34: error: expected ';' before ')' token
   10 |                 printf("%d",x-24));
      |                                  ^
      |                                  ;
main.c:10:34: error: expected statement before ')' token
Language: Java

import java.util.Scanner;
 
public class Main {
  public static void main(String[] args){
  Scanner scan = new Scanner(System.in);
   
  System.out.print("開始時刻");
  int A = scan.nextInt();
  System.out.print("経過時間");
  int B = scan.nextInt();
  scan.close();
 
  if((A + B) >= 0 && (A + B) <= 23 ){
  System.out.println("終了時間は" + (A + B) + "時です"); 
   }
  	else if((A + B) < 0 (A + B) >= 24){
  		System.out.println("もう一度");
  	}
 }
}

Compiler output:
Main.java:16: error: ')' expected
  	else if((A + B) < 0 (A + B) >= 24){
  	                   ^
Main.java:16: error: not a statement
  	else if((A + B) < 0 (A + B) >= 24){
  	                            ^
Main.java:16: error: ';' expected
  	else if((A + B) < 0 (A + B) >= 24){
  	                                 ^
3 errors
Language: C++

#include <stdio.h>

int
main()
{
   int i;

   i=1 + 1;
   printf("%d\n", i)

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ';' at end of input
    9 |    printf("%d\n", i)
      |                     ^
      |                     ;
a.cc:9:21: error: expected '}' at end of input
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: Java

import java.util.Scanner;
  Scanner scan = new Scanner(System.in);
   
  System.out.print("開始時刻");
  float a = scan.nextFloat();
  System.out.print("経過時間");
  float b = scan.nextFloat();
  scan.close();

  System.out.println("終了時間は" + (a + b) + "時です"); 


Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
  Scanner scan = new Scanner(System.in);
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: class, interface, enum, or record expected
  System.out.print("????");
  ^
Main.java:6: error: class, interface, enum, or record expected
  System.out.print("????");
  ^
Main.java:8: error: class, interface, enum, or record expected
  scan.close();
  ^
Main.java:10: error: class, interface, enum, or record expected
  System.out.println("?????" + (a + b) + "???"); 
  ^
5 errors
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		int a,b;
		Scanner s = new Scanner(System.in);
		a = s.next();
		b = s.next();
		System.out.println((a + b) % 24);
	}
}

Compiler output:
Main.java:7: error: incompatible types: String cannot be converted to int
		a = s.next();
		          ^
Main.java:8: error: incompatible types: String cannot be converted to int
		b = s.next();
		          ^
2 errors
Language: Java

public class Main {
	public static void main(String[] args) {
		int a,b;
		Scanner s = new Scanner(System.in);
		a = s.next();
		b = s.next();
		System.out.println((a + b) % 24);
	}
}

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

public class Main {
	public static void main(String[] args) {
		int a,b;
		Scanner s = new Scanner(System.in);
		a = s.next();
		b = s.next();
		System.out.println((a + b) 5 24);
	}
}

Compiler output:
Main.java:7: error: ')' or ',' expected
		System.out.println((a + b) 5 24);
		                          ^
1 error
Language: C

int main(void){
	//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
	
	int c1;
	
	char buf[256];
	fgets(buf,256,stdin);
	sscanf(buf,"%d",%c1);

	int c2;

	char buf[256];
	fgets(buf,256,stdin);
	sscanf(buf,"%d",%c2);
	
	while(c1 > 24){
		c1 = c1-24;
	} 
	while(c2 > 24){
		c2 = c2-24;
	}
	
	int t = c1 + c2;
	
	while(t > 24){
		t = t-24;
	}
	
	printf(t);
} 
	

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    7 |         fgets(buf,256,stdin);
      |         ^~~~~
main.c:7:23: error: 'stdin' undeclared (first use in this function)
    7 |         fgets(buf,256,stdin);
      |                       ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
    7 |         fgets(buf,256,stdin);
      |                       ^~~~~
main.c:8:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
    8 |         sscanf(buf,"%d",%c1);
      |         ^~~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:8:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:8:25: error: expected expression before '%' token
    8 |         sscanf(buf,"%d",%c1);
      |                         ^
main.c:12:14: error: redeclaration of 'buf' with no linkage
   12 |         char buf[256];
      |              ^~~
main.c:6:14: note: previous declaration of 'buf' with type 'char[256]'
    6 |         char buf[256];
      |              ^~~
main.c:14:25: error: expected expression before '%' token
   14 |         sscanf(buf,"%d",%c2);
      |                         ^
main.c:29:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |         printf(t);
      |         ^~~~~~
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:16: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   29 |         printf(t);
      |                ^
      |                |
      |                int
main.c:29:16: note: expected 'const char *' but argument is of type 'int'
Language: C

int main(void){
	//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
	
	int c1;
	int c2;
	
	char buf[256];
	fgets(buf,256,stdin);
	sscanf(buf,"%d",%c1);
	sscanf(buf,"%d",%c2);
	
	while(c1 > 24){
		c1 = c1-24;
	} 
	while(c2 > 24){
		c2 = c2-24;
	}
	
	int t = c1 + c2;
	
	while(t > 24){
		t = t-24;
	}
	
	printf(t);
} 
	

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    8 |         fgets(buf,256,stdin);
      |         ^~~~~
main.c:8:23: error: 'stdin' undeclared (first use in this function)
    8 |         fgets(buf,256,stdin);
      |                       ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
    8 |         fgets(buf,256,stdin);
      |                       ^~~~~
main.c:9:9: error: implicit declaration of function 'sscanf' [-Wimplicit-function-declaration]
    9 |         sscanf(buf,"%d",%c1);
      |         ^~~~~~
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:9:9: warning: incompatible implicit declaration of built-in function 'sscanf' [-Wbuiltin-declaration-mismatch]
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'sscanf'
main.c:9:25: error: expected expression before '%' token
    9 |         sscanf(buf,"%d",%c1);
      |                         ^
main.c:10:25: error: expected expression before '%' token
   10 |         sscanf(buf,"%d",%c2);
      |                         ^
main.c:25:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |         printf(t);
      |         ^~~~~~
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:16: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   25 |         printf(t);
      |                ^
      |                |
      |                int
main.c:25:16: note: expected 'const char *' but argument is of type 'int'
Language: C

int main void{
	//int 24times[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
	
	int c1;
	int c2;
	
	char buf[256];
	fgets(buf,256,stdin);
	sscanf(buf,"%d",%c1);
	sscanf(buf,"%d",%c2);
	
	while(c1 > 24){
		c1 = c1-24;
	} 
	while(c2 > 24){
		c2 = c2-24;
	}
	
	int t = c1 + c2;
	
	while(t > 24){
		t = t-24;
	}
	
	printf(t);
} 
	

Compiler output:
main.c:1:9: error: expected ';' before 'void'
    1 | int main void{
      |         ^~~~~
      |         ;
main.c:1:14: error: expected identifier or '(' before '{' token
    1 | int main void{
      |              ^
Language: C

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

//int main(int argc, char *argv[]){
//  int A = atoi(argv[1]);
//  int B = atoi(argv[2]);
//  int C;

int main(void){
  int A;
  int B;

  scanf("%d",&A);
  scanf("%d",&B);
  C = A + B;
  if(C > 23){
    C = C - 24;
    printf("%d\n",C);
  }else{
    printf("%d\n",C);
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:3: error: 'C' undeclared (first use in this function)
   15 |   C = A + B;
      |   ^
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <algorithm> 
#include <iostream> 
using namespace std; 
 
long long int a,b,c;
int main(){
cin>>a>>b;
c=a+b;
for(int i=0;i<2;i++){
if(c>24){
c-=24;
if(c<=24){
brake;
}
}
}
cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'brake' was not declared in this scope
   13 | brake;
      | ^~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	int a,ｂ;
	cin>>a,b;
	a=a+b;
	cout<<a%24<<endl;
	
}

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

#include <iostream>
using namespace std;
int main(void){
    // Here your code !
    int start, reaming;
    cin >> start >> reaming;
    if((start + reaming) > 24){
        cout << (start + reaming) - ((start + reaming) / 24));
    }else{
        cout << (start + reaming);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:61: error: expected ';' before ')' token
    8 |         cout << (start + reaming) - ((start + reaming) / 24));
      |                                                             ^
      |                                                             ;
Language: C++

        #include <iostream>
        #include <cstdlib>
        #include <cmath>
        using namespace std;
         
        int main(void)
        {
        int n, a, b, max, ans = 9999999999999;
        max = sqrt((double)n);
        for (int i = 1; i <= max; i++)
        if (n % i) ans = min(ans, log10(n / i) + 1);
        cout << ans << endl;
        return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: warning: overflow in conversion from 'long int' to 'int' changes value from '9999999999999' to '1316134911' [-Woverflow]
    8 |         int n, a, b, max, ans = 9999999999999;
      |                                 ^~~~~~~~~~~~~
a.cc:11:29: error: no matching function for call to 'min(int&, __gnu_cxx::__enable_if<true, double>::__type)'
   11 |         if (n % i) ans = min(ans, log10(n / i) + 1);
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:11:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   11 |         if (n % i) ans = min(ans, log10(n / i) + 1);
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

    #include <iostream>
    #include <cstdlib>
    #include <cmath>
    using namespace std;
     
    int main(void)
    {
    int n, a, b, max, ans = 9999999999999;
    max = sqrt((double)n);
    for (int i = 1; i <= MAX; i++)
    if (n % i) ans = min(ans, log10(N / i) + 1);
    cout << ans << endl;
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: warning: overflow in conversion from 'long int' to 'int' changes value from '9999999999999' to '1316134911' [-Woverflow]
    8 |     int n, a, b, max, ans = 9999999999999;
      |                             ^~~~~~~~~~~~~
a.cc:10:26: error: 'MAX' was not declared in this scope
   10 |     for (int i = 1; i <= MAX; i++)
      |                          ^~~
a.cc:11:37: error: 'N' was not declared in this scope
   11 |     if (n % i) ans = min(ans, log10(N / i) + 1);
      |                                     ^
Language: C++

#include<iostream>

using namespace std;

int main(){

	int a,b,N,M; cin >> N >> M;
	int A[50],B[50],C[50],D[50],ans[50],num[50];
	int dis;

	//cout << N << M <<endl;

	//Input of Students
	for(int i=0; i < N; i++)
		cin >> A[i] >> B[i];

	//Input of Check Point
	for(int i=0; i < M; i++)
		cin >> C[i] >> D[i];

	dis = 0;
	for(int i=0; i<50; i++){
		ans[i] =1000000000;
	}
	//Caluculation of Mahattan distance
	for(int i=0; i < N; i++){
		for(int j=0; j< M; j++){
			dis = abs(A[i]-C[j]) + abs(B[i]-D[j]);
			if(dis < ans[i] )	{
				ans[i] = dis;
				num[i] = j+1;
			}
		}
	}

	for(int i=0; i < N; i++)
		cout << num[i] <<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:37:39: error: expected '}' at end of input
   37 |                 cout << num[i] <<endl;
      |                                       ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

include<iostream>

using namespace std;

int main(){

        int A,B; cin >> A >>  B;

        if(A+B<=24)
                cout << A+B << endl;
        else
                cout << A+B -24<< endl;

}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:18: error: 'cin' was not declared in this scope
    7 |         int A,B; cin >> A >>  B;
      |                  ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout << A+B << endl;
      |                 ^~~~
a.cc:10:32: error: 'endl' was not declared in this scope
   10 |                 cout << A+B << endl;
      |                                ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << A+B -24<< endl;
      |                 ^~~~
a.cc:12:35: error: 'endl' was not declared in this scope
   12 |                 cout << A+B -24<< endl;
      |                                   ^~~~
Language: C

include <stdio.h>
int main(){

  int a,b;

  scanf("%d %d",&a,&b);

  printf("%d\n",(a+b)%24);

  return 0;

}




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

include <iostream>
using namespace std;
int main(){
	int A;
	int B;
	
	cin >> A >> B;
	
	if((A+B)<=24){
		cout<<A+B<<endl;}
	else{
		cout<<(A+B)-24<<endl;}
		
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> A >> B;
      |         ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout<<A+B<<endl;}
      |                 ^~~~
a.cc:10:28: error: 'endl' was not declared in this scope
   10 |                 cout<<A+B<<endl;}
      |                            ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout<<(A+B)-24<<endl;}
      |                 ^~~~
a.cc:12:33: error: 'endl' was not declared in this scope
   12 |                 cout<<(A+B)-24<<endl;}
      |                                 ^~~~
Language: C++


a, b = map(int, input().split(" "));
print( (a+b) % 24);

Compiler output:
a.cc:2:1: error: 'a' does not name a type
    2 | a, b = map(int, input().split(" "));
      | ^
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | print( (a+b) % 24);
      |      ^
Language: C

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

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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C++

include <stdio.h>
int main(){
  int a, b;
  a = 20;
  b = 5;
  if((a+b)>=24) printf("%d\n", ((a+b)-24));
  else printf("%d\n", (a+b));
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: Java

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int time = a + b;
		if (time >= 24) {
			time -= 24;
		}
		System.out.println(time);
		
		scan.close();
	}

}


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

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int time = a + b;
		if (time > 24) {
			time -= 24;
		}
		System.out.println(time);
		
		scan.close();
	}

}


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

import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int time = a + b;
		if (time > 24) {
			time -= 24;
		}
		System.out.println(time);
		
	}

}


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

#include<stdio.h>

int main(void){
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d\n",(a + b) % 24);
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:5: error: class, interface, enum, or record expected
    scanf("%d%d",&a,&b);
    ^
Main.java:6: error: class, interface, enum, or record expected
    printf("%d\n",(a + b) % 24);
    ^
Main.java:7: error: class, interface, enum, or record expected
    return 0;
    ^
Main.java:8: error: class, interface, enum, or record expected
}
^
6 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 C = A + B;
        if(C > 24){
            C = C-24;
        }

        System.out.println(C);
    }
}

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

#inlcude <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a + b) % 24 << endl;
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | 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 | #inlcude <iostream>
a.cc:6:1: error: 'cout' was not declared in this scope
    6 | cout << (a + b) % 24 << endl;
      | ^~~~
a.cc:6:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:25: error: 'endl' was not declared in this scope
    6 | cout << (a + b) % 24 << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude <iostream>
Language: C++

using ll=long long;
using R=double;

 // Combination Table
 ll C[51][51]; // C[n][k] -> nCk

 void comb_table(int N){
 for(int i=0;i<=N;++i){
 for(int j=0;j<=i;++j){
 if(j==0 or j==i){
 C[i][j]=1LL;
 }else{
 C[i][j]=(C[i-1][j-1]+C[i-1][j]);
 }
 }
 }
 }

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

 const int NMAX=50;
 ll v[NMAX];

 for(int i=0;i<N;++i){
 cin >> v[i];
 }

 comb_table(N);
 sort(v,v+N);
 reverse(v,v+N);

 R max_average=0.0;
 for(int i=0;i<A;++i){
 max_average+=v[i];
 }
 max_average/=A;

 int a_th_val_num=0,a_th_val_pos=0;
 for(int i=0;i<N;++i){
 if(v[i]==v[A-1]){
 a_th_val_num++;
 if(i<A){
 a_th_val_pos++;
 }
 }
 }

 ll cnt=0LL;
 if(a_th_val_pos==A){
 for(a_th_val_pos=A;a_th_val_pos<=B;++a_th_val_pos){
 cnt+=C[a_th_val_num][a_th_val_pos];
 }
 }else{
 cnt+=C[a_th_val_num][a_th_val_pos];
 }

 cout.precision(20);
 cout << fixed << max_average << endl;
 cout << cnt << endl;

 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: 'cin' was not declared in this scope
   21 |  cin >> N >> A >> B;
      |  ^~~
a.cc:31:2: error: 'sort' was not declared in this scope; did you mean 'short'?
   31 |  sort(v,v+N);
      |  ^~~~
      |  short
a.cc:32:2: error: 'reverse' was not declared in this scope
   32 |  reverse(v,v+N);
      |  ^~~~~~~
a.cc:59:2: error: 'cout' was not declared in this scope
   59 |  cout.precision(20);
      |  ^~~~
a.cc:60:10: error: 'fixed' was not declared in this scope
   60 |  cout << fixed << max_average << endl;
      |          ^~~~~
a.cc:60:34: error: 'endl' was not declared in this scope
   60 |  cout << fixed << max_average << endl;
      |                                  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
 
using namespace std;
 
int main(){
  int n, m, a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for(int i = 0; i < n; i++)cin >> a[i] >> b[i];
  for(int i = 0; i < m; i++)cin >> c[i] >> d[i];
  for(int i = 0; i < n; i++){
    int mindist = 300000000;
    int mini = -1;
    for(int cpi = 0; cpi < m; cpi++){
      int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
      if(mindist > dist){
        mindist = dist;
        mini = i;
      }
    }
    cout << mini << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: expected ',' or ';' before 'if'
   16 |       if(mindist > dist){
      |       ^~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int n, m, a[50], b[50], c[50], d[50];
  cin >> n >> m;
  for(int i = 0; i < n; i++)cin >> a[i] >> b[i];
  for(int i = 0; i < m; i++)cin >> c[i] >> d[i];
  for(int s = 0; s < n; s++){
    int mindist = 300000000;
    int mini = -1;
    for(int cpi = 0; cpi < m; cpi++){
      int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
      if(mindist > dist){
        mindist = dist;
        mini = i;
      }
    }
    cout << mini << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'i' was not declared in this scope
   15 |       int dist = abs(a[i] - c[cpi]) + (b[i] - d[cpi])
      |                        ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class beginner057 {
	public static void main(String[]args)throws IOException{
	
		BufferedReader br=
				new BufferedReader(new InputStreamReader(System.in));
		String str1=br.readLine();
		String[] str2 = str1.split(" ");
		int time=Integer.parseInt(str2[0])+Integer.parseInt(str2[1]);
		if(time>=24){
		  time=time-24;
		}
		System.out.println(time);
	}
	

}


Compiler output:
Main.java:6: error: class beginner057 is public, should be declared in a file named beginner057.java
public class beginner057 {
       ^
1 error
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();
		System.our.println((a+b)%24);
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		System.our.println((a+b)%24);
		      ^
  symbol:   variable our
  location: class System
1 error
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();
		System.our.println((a+b)%24)
	}
}

Compiler output:
Main.java:7: error: ';' expected
		System.our.println((a+b)%24)
		                            ^
1 error
Language: C

#include <stdio.h>

int abs(int j)
{
    return (j>0) ? j : -j;
}

int main()
{
    int N, M, i, j;
    int a[50], b[50], c[50], d[50],;
    int p[50] = {0};

    scanf("%d %d", &N, &M);
    
    for(i=0; i<N; i++)
    {
         scanf("%d %d", &a[i], &b[i]);
    }
    
    for(j=0; j<M; j++)
    {
         scanf("%d %d", &c[j], &d[j]);
    }
    
    for(i=0; i<N; i++)
    {
         for(j=0; j<M; j++)
         {
             if(abs(a[i] - c[j]) + abs(b[i] - d[j]) < abs(a[i] - c[p[i]]) + abs(b[i] - d[p[i]])
             {
                 p[i] = j;
             }
         }
         printf("%d\n", p[i]);
    }
}

Compiler output:
main.c: In function 'main':
main.c:11:36: error: expected identifier or '(' before ';' token
   11 |     int a[50], b[50], c[50], d[50],;
      |                                    ^
main.c:30:96: error: expected ')' before '{' token
   30 |              if(abs(a[i] - c[j]) + abs(b[i] - d[j]) < abs(a[i] - c[p[i]]) + abs(b[i] - d[p[i]])
      |                ~                                                                               ^
      |                                                                                                )
   31 |              {
      |              ~                                                                                  
main.c:34:10: error: expected expression before '}' token
   34 |          }
      |          ^
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 ans
                if(a+b<24){
ans=a+b-24;
}else{
ans=a+b;
}
		System.out.println(ans);
	}
}


Compiler output:
Main.java:8: error: ';' expected
int ans
       ^
1 error
Language: Java

import java.util.Scanner;

public class RemainingTime {
	public static void main(String[] args) {

		// input
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		scan.close();

		int res = (a + b) % 24;
		// output
		System.out.println(res);
	}
}

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

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = Scanner(System.in);

        int n = Integer.parseInt(sc.next());
        int m = Integer.parseInt(sc.next());

        System.out.println((n + m) % 24);

        sc.close();
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = Scanner(System.in);
                     ^
  symbol:   method Scanner(InputStream)
  location: class Main
1 error
Language: C++

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C=(A+B)%24;
		System.out.println(C);
		sc.close();
	}
}

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

#include <iostream>
#include <stdint>

using namespace std;

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

    if(a + b > 24) {
        cout << a + b - 24 << endl;
    }
    else {
        cout << a + b << endl;
    }
}

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

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

int main(void)
{
	int i, num, rem,min,len;
	double lim;
	char wln[13];

	//整数Nの入力
	scanf("%d", &num);
	
	lim = sqrt(num)-1.0;
	min = 11;

	for (i = num; i >lim; i--) {
		rem = num%i;
		if (rem == 0) {
			itoa(i, wln, 10);
			len= strlen(wln);
			if (len < min) {
				min = len;
			}
		}
		
	}
	printf("%d", min);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:25: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   21 |                         itoa(i, wln, 10);
      |                         ^~~~
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		int a, b,time;
		Scanner sc = new Scanner();
		a = sc.nextInt();
		b = sc.nextInt();

		time = (a+b) % 24;
		System.out.println(time);
	}
}

	

	


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

public class Main{
	public static void main(String[] args){
		int a, b,time;
		Scanner sc = new Scanner();

		a = sc.nextInt();
		b = sc.nextInt();

		time = (a+b) % 24;
		System.out.println(time);
	}
}

	


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

public class Main{
	public static main(String[] args){
		int a, b,time;
		Scanner sc = new Scanner();

		a = sc.nextInt();
		b = sc.nextInt();

		time = (a+b) % 24;
		System.out.println(time);
	}
}

	


Compiler output:
Main.java:2: error: invalid method declaration; return type required
	public static main(String[] args){
	              ^
1 error
Language: Java

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

        Scanner sc  = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int W = Integer.parseInt(sc.next());

        int ans;
        
        if(N+W>24)          ans = Math.abs(24-(N+W));
        else if(N+W==24)    ans = 0; 
        else                ans = N+W
        
        
        System.out.println(ans);
    }

}

Compiler output:
Main.java:16: error: ';' expected
        else                ans = N+W
                                     ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Dell on 28-03-2017.
 */
public class TaskB {
    static void solve(Long[] numbers, int a, int b) {
        Arrays.sort(numbers, Collections.reverseOrder());
        HashMap<Long, Integer> freqMap = new HashMap<>();
        Arrays.stream(numbers).forEach(num -> freqMap.put(num, freqMap.getOrDefault(num, 0) + 1));

        Map<Long, Integer> candidateMap = new HashMap<>();
        for (int i = 0; i < a; i++) {
            candidateMap.put(numbers[i], candidateMap.getOrDefault(numbers[i], 0) + 1);
        }

        long ways = 1L;
        for (Map.Entry<Long, Integer> entry : candidateMap.entrySet()) {
            ways *= freqMap.get(entry.getKey()) / entry.getValue();
        }

        double mean = 0.0d;
        for (int i = 0; i < a; i++) {
            mean += numbers[i];
        }
        mean /= a;

        System.out.printf("%.06f\n", mean);
        System.out.println(ways);
    }

    static Integer[] readIntArray(BufferedReader br) throws IOException {
        String s = br.readLine();
        String[] tokens = s.trim().split(" +");
        Integer[] array = new Integer[tokens.length];
        for (int i = 0; i < tokens.length; i++) {
            array[i] = Integer.valueOf(tokens[i]);
        }
        return array;
    }

    static Long[] readLongArray(BufferedReader br) throws IOException {
        String s = br.readLine();
        String[] tokens = s.trim().split(" +");
        Long[] array = new Long[tokens.length];
        for (int i = 0; i < tokens.length; i++) {
            array[i] = Long.valueOf(tokens[i]);
        }
        return array;
    }

    public static void main(String[] args) {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            Integer[] nab = readIntArray(br);
            Long[] array = readLongArray(br);
            solve(array, nab[1], nab[2]);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


Compiler output:
Main.java:12: error: class TaskB is public, should be declared in a file named TaskB.java
public class TaskB {
       ^
1 error
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();
			int c=(a+b)%24;
			System.out.println(c);
	}
}

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

			Scanner sc = new Scanner(System.in);
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c=(a+b)%24;
			System.out.println(c);

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
			Scanner sc = new Scanner(System.in);
			^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
			System.out.println(c);
			^
2 errors
Language: Java

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt(),b = scanner.nextInt();
		if(a + b > 24){
			System.out.println((a + b) % 24);
		}else if(a + b == 24){
			System.out.println(0);
		}else{
			System.out.println(a + b);
		}
	}
}


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

#include <cstdio>
 
using namespace std;
 
int a,b;
 
int main(){
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%24);
return 0;
}

Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |  
      | ^
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
a.cc:6:1: error: '\U000000a0' does not name a type
    6 |  
      | ^
Language: C++

#include <cstdio>

using namespace std;

int a,b;

int main(){
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)%);
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected primary-expression before ')' token
    9 | printf("%d\n",(a+b)%);
      |                     ^
Language: Java

import java.util.Scanner;

public class RemainingTime {

    private Scanner scanner = new Scanner(System.in);

    private void main() {
        int currentHours = scanner.nextInt();
        int contestBeginFor = scanner.nextInt();

        System.out.println((currentHours + contestBeginFor) % 24);
    }

    public static void main(String[] args) {
        RemainingTime clazz = new RemainingTime();
        clazz.main();
    }

}

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

public class Main{
	private static Scanner sc;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		int A =sc.nextInt();
		int B =sc.nextInt();
		int K;
		K=A+B;
		if(K>=24){
			K=K-24;
		}
		System.out.println(K);
	}

}


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

#include<stdio.h>
int a ;
int b ;
void main() {
	int x = a + b;
	if (x >= 24) {
		printf("%d\n", x - 24);
	}	printf("%d\n",x);
}

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

#include<stdio.h>
int a = 9;
int b = 12;
void main() {
	int x = a + b;
	if (x >= 24) {
		printf("%d\n", x - 24);
	}	printf("%d\n",x);
}

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

#include<stdio.h>
int a = 9;
int b = 12;
void solve() {
	int x = a + b;
	if (x >= 24) {
		printf("%d\n", x - 24);
	}	printf("%d\n",x);
}

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++

a,b=gets.split.map &:to_i;p (a+b)%24

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b=gets.split.map &:to_i;p (a+b)%24
      | ^
a.cc:1:29: error: expected constructor, destructor, or type conversion before '(' token
    1 | a,b=gets.split.map &:to_i;p (a+b)%24
      |                             ^
Language: C

#include <stdio.h>

int main(){
  int a, b;
  scanf("%d %d",&a,&b);
  prinft("%d¥n",(a+b)%24);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'prinft'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |   prinft("%d¥n",(a+b)%24);
      |   ^~~~~~
      |   printf
Language: C++

import Control.Applicative

main = do
  ss <- (map read . words) <$> getLine 
  putStrLn (sum ss `mod` 24)

Compiler output:
a.cc:5:20: error: stray '`' in program
    5 |   putStrLn (sum ss `mod` 24)
      |                    ^
a.cc:5:24: error: stray '`' in program
    5 |   putStrLn (sum ss `mod` 24)
      |                        ^
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Applicative
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C

include<stdio.h>

int main(void){
    int a,b;
    scanf("%d %d",&a,&b);
    int h;
    h = (a + b) % 24;
    printf("%d\n",h);
    return 0;
}

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

public class Main {
 public static void main(String[] args) {
  Scanner s = new Scanner(System.in);
  System.out.println((s.nextInt() + s.nextInt())%24);
 }
}

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

#include<stdio.h>
#include<math.h>
int main()
{
  int N;
  scanf("%d",&N);
  int A,B,i,least,f;
  for(A=1;A<=N;A++)
  {
    if(N%A)
    continue;
    else
    B=N/A;
    if(A>=B)
    {
      while(A/pow(10,i)>1)
      i++;
      f=(int)(A/pow(10,i);
    }
    else
    {
       while(B/pow(10,i)>1)
      i++;
      f=(int)(B/pow(10,i);
    }
    if(least>f)
    least=f;
  }
 printf("%d",least);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ')' before ';' token
   18 |       f=(int)(A/pow(10,i);
      |              ~           ^
      |                          )
a.cc:24:26: error: expected ')' before ';' token
   24 |       f=(int)(B/pow(10,i);
      |              ~           ^
      |                          )
Language: C++

#include<stdio.h>
int main()
{
    int a,b,c;
    // 整数の入力
    scanf("%d %d", &a,&b);
    if (a+b=>24){c=a+b-24;}
    else{c=a+b;}
    printf("%d",c);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected primary-expression before '>' token
    7 |     if (a+b=>24){c=a+b-24;}
      |             ^
Language: C++

#include<stdio.h>
int main()
{
    int a,b,c;
    // 整数の入力
    scanf("%d %d", &a,&b);
    if (a+b>24){c=a+b-24}
    printf("%d",c);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before '}' token
    7 |     if (a+b>24){c=a+b-24}
      |                         ^
      |                         ;
Language: C++


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

// 問2

class cPOINT{
public:
	long lnX;
	long lnY;
	cPOINT() { lnX = 0; lnY = 0; };
	cPOINT& operator=(const cPOINT &obj);
	cPOINT operator-(const cPOINT &obj);
	double calc();
};
cPOINT& cPOINT::operator=(const cPOINT &obj)
{
	lnX = obj.lnX;
	lnY = obj.lnY;
	return *this;
}
cPOINT cPOINT::operator-(const cPOINT &obj)
{
	cPOINT cTmp;
	cTmp.lnX =  this->lnX - obj.lnX;
	cTmp.lnY = this->lnY - obj.lnY;
	return cTmp;
}

double cPOINT::calc()
{
	double dbPowX = pow(lnX, 2);
	double dbPowY = pow(lnY, 2);
	return sqrt(dbPowX + dbPowY);
}


int main()
{
	long lnCntN;
	long lnCntM;
	cin >> lnCntN;
	cin >> lnCntM;

	vector<cPOINT> vecN(lnCntN);
	vector<cPOINT> vecM(lnCntM);

	for (int i = 0; i < lnCntN; i++)
	{
		cPOINT stAdd;
		cin >> stAdd.lnX;
		cin >> stAdd.lnY;
		vecN[i] = stAdd;
	}
	for (int i = 0; i < lnCntM; i++)
	{
		cPOINT stAdd;
		cin >> stAdd.lnX;
		cin >> stAdd.lnY;
		vecM[i] = stAdd;
	}

	for (int i = 0; i < lnCntN; i++)
	{
		int nIdxM=0;	// 1番近いチェックポイントデータのIndex;
		double dbNearVal = LONG_MAX;	// 1番近いチェックポイントまでの距離
		for (int j=0; j < lnCntM; j++)
		{
			cPOINT cTmp = vecN[i] - vecM[j];
			double dbVal = cTmp.calc();
			if (dbVal < dbNearVal)
			{
				dbNearVal = dbVal;
				nIdxM = j;
			}
		}
		if (i == lnCntN-1)
			cout << nIdxM + 1;
		else
			cout << nIdxM + 1 << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:36: error: 'LONG_MAX' was not declared in this scope
   70 |                 double dbNearVal = LONG_MAX;    // 1番近いチェックポイントまでの距離
      |                                    ^~~~~~~~
a.cc:7:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <math.h>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

#include<stdio.h>
int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  printf("%d\n",(a+b)%24);j
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:27: error: 'j' was not declared in this scope
    5 |   printf("%d\n",(a+b)%24);j
      |                           ^
Language: C++

#include <iostream>

using namespace std;

int main() {
	int A, B;
	cin >> A >> B;
	if ( ( A + B )  < 24 ) cout << A + B << endl;
	else cout << (A + B) - 24 enld;
	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before 'enld'
    9 |         else cout << (A + B) - 24 enld;
      |                                  ^~~~~
      |                                  ;