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

404 Not Found
#include <cstdio>

int main()
{
	float n;
	int m;
	const char *rank[] = {"light fly", "fly", "bantam", "feather", "light", "light welter",
		"welter", "light middle", "middle", "light heavy", "heavy"};
	while(~scanf("%f\n", &n)){
		if(n <= 48.0) m = 0;
		else if(n <= 51.0) m = 1;
		else if(n <= 54.0) m = 2;
		else if(n <= 57.0) m = 3;
		else if(n <= 60.0) m = 4;
		else if(n <= 64.0) m = 5;
		else if(n <= 69.0) m = 6;
		else if(n <= 75.0) m = 7;
		else if(n <= 81.0) m = 8;
		else if(n <= 91.0) m = 9;
		else m = 10;
		puts(rank[m]);
	}
	return 0;
}

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

main(float v){for(;~scanf("%f",&v);)puts(v>91?"heavy":v>81?"light heavy":v>75?"middle":v>69?"light middle":v>64?"welter":v>60?"light welter":v>57?"light":v>54?"feather":v>51?"bantam":v>48?"fly":"light fly");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(float v){for(;~scanf("%f",&v);)puts(v>91?"heavy":v>81?"light heavy":v>75?"middle":v>69?"light middle":v>64?"welter":v>60?"light welter":v>57?"light":v>54?"feather":v>51?"bantam":v>48?"fly":"light fly");}
      | ^~~~
a.cc:1:1: warning: first argument of 'int main(float)' should be 'int' [-Wmain]
a.cc:1:1: warning: 'int main(float)' takes only zero or two arguments [-Wmain]
a.cc: In function 'int main(float)':
a.cc:1:21: error: 'scanf' was not declared in this scope
    1 | main(float v){for(;~scanf("%f",&v);)puts(v>91?"heavy":v>81?"light heavy":v>75?"middle":v>69?"light middle":v>64?"welter":v>60?"light welter":v>57?"light":v>54?"feather":v>51?"bantam":v>48?"fly":"light fly");}
      |                     ^~~~~
a.cc:1:37: error: 'puts' was not declared in this scope
    1 | main(float v){for(;~scanf("%f",&v);)puts(v>91?"heavy":v>81?"light heavy":v>75?"middle":v>69?"light middle":v>64?"welter":v>60?"light welter":v>57?"light":v>54?"feather":v>51?"bantam":v>48?"fly":"light fly");}
      |                                     ^~~~
Language: C++

nclude <iostream>
using namespace std;
 
int main()
{
  double w;
    
    while (cin >> w){
      if (w <= 48.0)  cout << "light fly";

      else if (w <= 51.0) cout << "fly";

      else if (w <= 54.0) cout << "bantam";

      else if (w <= 57.0) cout << "feather";

      else if (w <= 60.0) cout << "light";

      else if (w <= 64.0) cout << "light welter";

      else if (w <= 69.0) cout << "welter";

      else if (w <= 75.0) cout << "light middle";

      else if (w <= 81.0) cout << "middle";

      else if (w <= 91.0) cout << "light heavy";

      else  cout << "heavy";
      cout << endl;
    }

    return (0);
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:12: error: 'cin' was not declared in this scope
    8 |     while (cin >> w){
      |            ^~~
a.cc:9:23: error: 'cout' was not declared in this scope
    9 |       if (w <= 48.0)  cout << "light fly";
      |                       ^~~~
a.cc:11:27: error: 'cout' was not declared in this scope
   11 |       else if (w <= 51.0) cout << "fly";
      |                           ^~~~
a.cc:13:27: error: 'cout' was not declared in this scope
   13 |       else if (w <= 54.0) cout << "bantam";
      |                           ^~~~
a.cc:15:27: error: 'cout' was not declared in this scope
   15 |       else if (w <= 57.0) cout << "feather";
      |                           ^~~~
a.cc:17:27: error: 'cout' was not declared in this scope
   17 |       else if (w <= 60.0) cout << "light";
      |                           ^~~~
a.cc:19:27: error: 'cout' was not declared in this scope
   19 |       else if (w <= 64.0) cout << "light welter";
      |                           ^~~~
a.cc:21:27: error: 'cout' was not declared in this scope
   21 |       else if (w <= 69.0) cout << "welter";
      |                           ^~~~
a.cc:23:27: error: 'cout' was not declared in this scope
   23 |       else if (w <= 75.0) cout << "light middle";
      |                           ^~~~
a.cc:25:27: error: 'cout' was not declared in this scope
   25 |       else if (w <= 81.0) cout << "middle";
      |                           ^~~~
a.cc:27:27: error: 'cout' was not declared in this scope
   27 |       else if (w <= 91.0) cout << "light heavy";
      |                           ^~~~
a.cc:29:13: error: 'cout' was not declared in this scope
   29 |       else  cout << "heavy";
      |             ^~~~
a.cc:30:7: error: 'cout' was not declared in this scope
   30 |       cout << endl;
      |       ^~~~
a.cc:30:15: error: 'endl' was not declared in this scope
   30 |       cout << endl;
      |               ^~~~
Language: C++

import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			double x = sc.nextDouble();
			System.out.println(x<=48?"light fly":
				x<=51?"fly":
				x<=54?"bantam":
				x<=57?"feather":
				x<=60?"light":
				x<=64?"light welter":
				x<=69?"welter":
				x<=75?"light middle":
				x<=81?"middle":
				x<=91?"light heavy":"heavy");
		}
	}
}

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

#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	string s[11] = {
		"light fly",
		"fly",
		"bantam",
		"feather",
		"light",
		"light welter",
		"welter",
		"light middle",
		"middle",
		"light heavy",
		"heavy",
	};
	int a[12] = { 0,48,51,54,57,60,64,69,75,81,91,INT_MAX };

	for (double b; cin >> b;)
		for (int i = 0; i < 11; i++)
			if (a[i] <= b&&b < a[i + 1]) {
				cout << s[i] << endl;
				break;
			}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:55: error: 'INT_MAX' was not declared in this scope
   33 |         int a[12] = { 0,48,51,54,57,60,64,69,75,81,91,INT_MAX };
      |                                                       ^~~~~~~
a.cc:16:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include<queue>
  +++ |+#include <climits>
   16 | #include<vector>
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<limits>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	string s[11] = {
		"light fly",
		"fly",
		"bantam",
		"feather",
		"light",
		"light welter",
		"welter",
		"light middle",
		"middle",
		"light heavy",
		"heavy",
	};
	int a[12] = { 0,48,51,54,57,60,64,69,75,81,91,INT_MAX };

	for (double b; cin >> b;)
		for (int i = 0; i < 11; i++)
			if (a[i] <= b&&b < a[i + 1]) {
				cout << s[i] << endl;
				break;
			}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:55: error: 'INT_MAX' was not declared in this scope
   34 |         int a[12] = { 0,48,51,54,57,60,64,69,75,81,91,INT_MAX };
      |                                                       ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include<queue>
  +++ |+#include <climits>
   17 | #include<vector>
Language: C++

#include <iostream>
using namespace std;

int main()
{
	double kg;

	while (cin >> kg){
		if (kg <= 48.0) cout << "light fly" << endl;
		else if (kg <= 51.0) cout << "fly" << endl;
		else if (kg <= 54.0) cout << "bantam" << endl;
		else if (kg <= 57.0) cout << "feather" << endl;
		else if (kg <= 60.0) cout << "light" << endl;
		else if (kg <= 64.0) cout << "light welter" << endl;
		else if (kg <= 69.0) cout << "welter" << endl;
		else if (kg <= 75.0) cout << "light middle" << endl;
		else if (kg <= 81.0) cout << "middle" << endl;
		else if (kg <= 91.0) cout << "light heavy" << endl;
		else cout << "heavy" << endl;
	
	return (0);
}

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

#include<iostream>
using namespace std;
int main(){
	double w;
	while(cin >> w){
		if(w <= 48.00) 
			cout << "light fly" << endl;
		else if(w <= 51.00) 
			cout << "fly" << endl;
		else if(w <= 54.00) 
			cout << "bantam" <, endl;
		else if(w <= 57.00) 
			cout << "feather" << endl;
		else if(w <= 60.00) 
			cout << "light" << endl;
		else if(w <= 64.00) 
			cout << "light welter" <, endl;
		else if(w <= 69.00) 
			cout << "welter" << endl;
		else if(w <= 75.00) 
			cout << "light middle" << endl;
		else if(w <= 81.00) 
			cout << "middle" << endl;
		else if(w <= 91.00) 
			cout << "light heavy" <, endl;
		else 
			cout << "heavy" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:43: error: expected primary-expression before ',' token
   11 |                         cout << "bantam" <, endl;
      |                                           ^
a.cc:17:49: error: expected primary-expression before ',' token
   17 |                         cout << "light welter" <, endl;
      |                                                 ^
a.cc:25:48: error: expected primary-expression before ',' token
   25 |                         cout << "light heavy" <, endl;
      |                                                ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
	double w[50];
	string k[50];
	int i = 0;
	while (cin >> w[i]) {
		i++;
	}
	for (int j = 0; j < i; j++) {
		if (w[j] <= 48.00) {
			k[j] = "light fly";

		}
		else if ((w[j] > 48.00) && (w[j] <= 51.00)) {
			k[j] = "fly";
		}
		else if ((w[j] > 51.00) && (w[j] <= 54.00)) {
			k[j] = "bantam";
		}
		else if ((w[j] > 54.00) && (w[j] <= 57.00)) {
			k[j] = "feather";
		}
		else if ((w[j] > 57.00) && (w[j] <= 60.00)) {
			k[j] = "light";
		}
		else if ((w[j] > 60.00) && (w[j] <= 64.00)) {
			k[j] = "light welter";
		}
		else if ((w[j] > 64.00) && (w[j] <= 69.00)) {
			k[j] = "welter";
		}
		else if ((w[j] > 69.00) && (w[j] <= 75.00)) {
			k[j] = "light middle";
		}
		else if ((w[j] > 75.00) && (w[j] <= 81.00)) {
			k[j] = "middle";

		}
		else if ((w[j] > 81.00) && (w[j] <= 91.00)) {
			k[j] = "light heavy";
		}
		else {
			k[j] = "heavy";
		}
		cout << k[j] << endl;
	}


	return 0;

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

#include<iostream>
using namespace std;
int main(){
	float w;
	while(cin>>w){
		if(w<=48.00){
			cout<<"light fly"<<endl;
		}else if(w>48.00&&w<=51.00){
			cout<<"fly"<<endl;
		}else if(w>51.00&&w<=54.00){
			cout<<"bantam"<<endl;
		}else if(w>54.00&&w<=57.00){
			cout<<"feather"<<endl;
		}else if(w>57.00&&w<=60.00){
			cout<<"light"<<endl;
		}else if(w>60.00&&w<=64.00){
			cout<<"light welter"<<endl;
		}else if(w>64.00&&w<=69.00){
			cout<<"welter"<<endl;
		}else if(w>69.00&&w<=75.00){
			cout<<"light middle"<<endl;
		}else if(w>75.00&&w<81.00){
			cout<<"middle"<<endl;
		}else if(w>81.00&&w<=91.00){
			cout<<"light heavy"<<endl;
		}else{
			cout<<"heavy"<<endl:
		}
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:44: error: expected ';' before ':' token
   27 |                         cout<<"heavy"<<endl:
      |                                            ^
      |                                            ;
a.cc:30:10: error: expected '}' at end of input
   30 |         }
      |          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>

using namespace std;

int main() {
	double weight;
	while (cin >> n) {
		if (n <= 48.0) cout << "light fly" << endl;
		else if (n <= 51.0) cout << "fly" << endl;
		else if (n <= 54.0) cout << "bantam" << endl;
		else if (n <= 57.0) cout << "feather" << endl;
		else if (n <= 60.0) cout << "light" << endl;
		else if (n <= 64.0) cout << "light welter" << endl;
		else if (n <= 69.0) cout << "welter" << endl;
		else if (n <= 75.0) cout << "light middle" << endl;
		else if (n <= 81.0) cout << "middle" << endl;
		else if (n <= 91.0) cout << "light heavy" << endl;
		else cout << "heavy" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'n' was not declared in this scope
    7 |         while (cin >> n) {
      |                       ^
Language: C++

#include <stdio.h>
int main(){
double n;
while(scanf("%d",&n)!=EOF){
if(n<=48){
printf("light fly\n");
}else if(n<=51){
printf("fly\n");
}else if(n<=54){
printf("bantam\n");
}else if(n<=57){
printf("feather\n");
}else if(n<=60){
printf("light\n");
}else if(n<=64){
printf("light welter\n");
}else if(n<=69){
printf("welter\n");
}else if(n<=75){
printf("light middle\n");
}else if(n<=81){
printf("middle\n");
}else if(n<=91){
printf("light heavy\n")
}else{
printf("heavy\n");
}}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before '}' token
   24 | printf("light heavy\n")
      |                        ^
      |                        ;
   25 | }else{
      | ~
Language: C++

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

int main(){
double a[10]={48,51,54,57,60,64,69,75,81,91};
string c[11]={"light 

fly","fly","bantam","feather","light","light 

welter","welter","light middle","middle","light 

heavy","heavy"};
double b;
bool ans;
while(cin>>b){
ans=false;
for(int i=0;i<10;i++){
if(b<=a[i]){cout<<c[i]<<endl; ans=true; break;}}
if(!ans)cout<<c[10]<<endl;}}

Compiler output:
a.cc:7:15: warning: missing terminating " character
    7 | string c[11]={"light
      |               ^
a.cc:7:15: error: missing terminating " character
    7 | string c[11]={"light
      |               ^~~~~~ 
a.cc:13:14: warning: missing terminating " character
   13 | heavy","heavy"};
      |              ^
a.cc:13:14: error: missing terminating " character
   13 | heavy","heavy"};
      |              ^~~
a.cc: In function 'int main()':
a.cc:9:1: error: 'fly' was not declared in this scope
    9 | fly","fly","bantam","feather","light","light
      | ^~~
a.cc:9:4: error: expected '}' before user-defined string literal
    9 | fly","fly","bantam","feather","light","light
      |    ^~~~~~
a.cc:7:14: note: to match this '{'
    7 | string c[11]={"light
      |              ^
a.cc:9:4: error: expected ',' or ';' before user-defined string literal
    9 | fly","fly","bantam","feather","light","light
      |    ^~~~~~
a.cc:16:12: error: 'b' was not declared in this scope
   16 | while(cin>>b){
      |            ^
Language: C++

#include <iostream>
#include <string>

#define LIGHT_FLY	48.00
#define FLY		 	51.00
#define BANTAM		54.00
#define FEATHER		57.00
#define LIGHT		60.00
#define LIGHT_WELTER 64.00
#define WELTER		69.00
#define LIGHT_MIDDLE 75.00
#define MIDDLE		81.00
#define LIGHT_HEAVY	91.00

using namespace std;

int main() {
	double weight;
	string strWeight;
	while(cin>>weight, !cin.eof()){
		strWeight = "";
		switch(weight){
			case LIGHT_FLY:
				strWeight = "light fly"; break;
			case FLY:
				strWeight = "fly"; break;
			case BANTAM:
				strWeight = "bantam"; break;
			case FEATHER:
				strWeight = "feather"; break;
			case LIGHT:
				strWeight = "light"; break;
			case LIGHT_WELTER:
				strWeight = "light welter"; break;
			case WELTER:
				strWeight = "welter"; break;
			case LIGHT_MIDDLE:
				strWeight = "light middle"; break;
			case MIDDLE:
				strWeight = "middle"; break;
			case LIGHT_HEAVY:
				strWeight = "light heavy"; break;
			default:
				strWeight = "heavy"; break;
		}
		cout<<strWeight<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: switch quantity not an integer
   22 |                 switch(weight){
      |                        ^~~~~~
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = 0;
		int b = 0; 
		int ab = 0;
		int o = 0;
		while(true){
			String x = sc.next();
			String[] str = x.split(",",0);
			if(str[1].equals("A"))a++;
			if(str[1].equals("B"))b++;
			if(str[1].equals("AB"))ab++;
			if(str[1].equals("O"))o++;
		}
		System.out.println(a);
		System.out.println(b);
		System.out.println(ab);
		System.out.println(o);
	}
}

Compiler output:
Main.java:18: error: unreachable statement
		System.out.println(a);
		^
1 error
Language: Java

//
//  main.cpp
//  AizuOnline
//
//  Created by ?????¬ ?????? on 19/05/2016.
//  Copyright ?? 2016 ?????¬ ??????. All rights reserved.
//

#include <iostream>

int main(int argc, const char * argv[]) {
    int a = 0;
    int b = 0;
    int ab = 0;
    int o = 0;
    int k;
    char s[5];
    
    while (scanf("%d,%s",&k,s)!= EOF){
        if(s[0] == 'A' && s[1] == 'B'){
            ab = ab + 1;
        }else if(s[0] == 'A'){
            a++;
        }else if(s[0] == 'B'){
            b++;
        }else if(s[0] == 'O'){
            o++;
        }
        
         std::cout << a << std::endl;
        std::cout << b << std::endl;
        std::cout << ab << std::endl;
        std::cout << o << std::endl;
        
    }
    
        }

Compiler output:
Main.java:9: error: illegal character: '#'
#include <iostream>
^
Main.java:9: error: unnamed classes are a preview feature and are disabled by default.
#include <iostream>
         ^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: illegal start of type
int main(int argc, const char * argv[]) {
                   ^
Main.java:11: error: class, interface, enum, or record expected
int main(int argc, const char * argv[]) {
                         ^
Main.java:17: error: class, interface, enum, or record expected
    char s[5];
    ^
Main.java:19: error: class, interface, enum, or record expected
    while (scanf("%d,%s",&k,s)!= EOF){
    ^
Main.java:22: error: class, interface, enum, or record expected
        }else if(s[0] == 'A'){
        ^
Main.java:24: error: class, interface, enum, or record expected
        }else if(s[0] == 'B'){
        ^
Main.java:26: error: class, interface, enum, or record expected
        }else if(s[0] == 'O'){
        ^
Main.java:28: error: class, interface, enum, or record expected
        }
        ^
Main.java:31: error: class, interface, enum, or record expected
        std::cout << b << std::endl;
        ^
Main.java:32: error: class, interface, enum, or record expected
        std::cout << ab << std::endl;
        ^
Main.java:33: error: class, interface, enum, or record expected
        std::cout << o << std::endl;
        ^
Main.java:35: error: class, interface, enum, or record expected
    }
    ^
14 errors
Language: Java

import java.util.Scanner;
import java.io.*;
class Main {
public static void main(String[] args)throws IOException{
int[] blood = new int[4];
BufferedReader br = new BufferedReader(new　InputStreamReader(System.in));
String buf;
while((buf = br.readLine())!=null){
String b = buf.split(",")[1];
if("A".equals(b))
blood[0]++;
else if("B".equals(b))
blood[1]++;
else if("AB".equals(b))
blood[2]++;
else
blood[3]++;
}
for(int i =0; i<blood.length;i++){
System.out.println(blood[i]);
}
}
}

Compiler output:
Main.java:6: error: illegal character: '\u3000'
BufferedReader br = new BufferedReader(new?InputStreamReader(System.in));
                                          ^
Main.java:6: error: ';' expected
BufferedReader br = new BufferedReader(new?InputStreamReader(System.in));
                                                                       ^
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class BloodGroups {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String str,arr[];
		List<String> list = new ArrayList<String>();
		while(null!=(str = in.readLine())){
			arr = str.split(",",0);
			list.add(arr[1]);
		}
		System.out.println(count("A",list));
		System.out.println(count("B",list));
		System.out.println(count("AB",list));
		System.out.println(count("O",list));
	}

	private static long count(String bl,List<String> list){
		int i=0;
		while(list.remove(new String(bl)))i++;
		return i;
	}
}

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

#include <iostream>#include <string>using namespace std;  int main() {  string str;  int a = 0, b = 0, ab = 0, o = 0;  while (getline(cin, str)) {    string s = str.substr(str.find_first_of(",")+1);    if (s == "A") {      a++;    } else if (s == "B") {      b++;    } else if (s == "O") {      o++;    } else {      ab++;    }  }  cout << a << endl << b << endl << ab << endl << o << endl;  return 0;}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>#include <string>using namespace std;  int main() {  string str;  int a = 0, b = 0, ab = 0, o = 0;  while (getline(cin, str)) {    string s = str.substr(str.find_first_of(",")+1);    if (s == "A") {      a++;    } else if (s == "B") {      b++;    } else if (s == "O") {      o++;    } else {      ab++;    }  }  cout << a << endl << b << endl << ab << endl << o << endl;  return 0;}
^
Main.java:1: error: illegal character: '#'
#include <iostream>#include <string>using namespace std;  int main() {  string str;  int a = 0, b = 0, ab = 0, o = 0;  while (getline(cin, str)) {    string s = str.substr(str.find_first_of(",")+1);    if (s == "A") {      a++;    } else if (s == "B") {      b++;    } else if (s == "O") {      o++;    } else {      ab++;    }  }  cout << a << endl << b << endl << ab << endl << o << endl;  return 0;}
                   ^
Main.java:1: error: not a statement
#include <iostream>#include <string>using namespace std;  int main() {  string str;  int a = 0, b = 0, ab = 0, o = 0;  while (getline(cin, str)) {    string s = str.substr(str.find_first_of(",")+1);    if (s == "A") {      a++;    } else if (s == "B") {      b++;    } else if (s == "O") {      o++;    } else {      ab++;    }  }  cout << a << endl << b << endl << ab << endl << o << endl;  return 0;}
                                                                                                                                                                                                                                                                                                                                                                                              ^
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
#include <iostream>#include <string>using namespace std;  int main() {  string str;  int a = 0, b = 0, ab = 0, o = 0;  while (getline(cin, str)) {    string s = str.substr(str.find_first_of(",")+1);    if (s == "A") {      a++;    } else if (s == "B") {      b++;    } else if (s == "O") {      o++;    } else {      ab++;    }  }  cout << a << endl << b << endl << ab << endl << o << endl;  return 0;}
                                                          ^
  (use --enable-preview to enable unnamed classes)
4 errors
Language: Java




import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.PrintStream; class Main {     public static void main(String[] args) throws IOException {        doit(args, System.in, System.out);    }     static void doit(String[] args, InputStream in, PrintStream out)            throws IOException {        BufferedReader reader = new BufferedReader(new InputStreamReader(in));        int[] counts = new int[4];        while (true) {            String line = reader.readLine();            if (line == null || line.isEmpty()) {                break;            }            String[] values = line.split(",");            String type = values[1];            if (type.equals("A")) {                counts[0]++;            } else if (type.equals("B")) {                counts[1]++;            } else if (type.equals("AB")) {                counts[2]++;            } else {                counts[3]++;            }        }        for (int count : counts) {            out.println(count);        }    }} 




Compile Error Logs:





 

Status 


Judge: 1/1 

JAVA 

CPU: 00.04 sec 

Memory: 8976 [KB] 

Length: 1102 [B] 

2012-10-08 15:16 

2012-10-08 15:16 

Results for testcases

 


















Case #1: 

: Accepted 

-
 
-

 - 

NA 

- 

NA 






< |
 
1
 
/ 

1
 
| > 

 
 
 : Accepted        -        -
 

 
 


Input #1 ( )
 

Output #1 ( )
 



Not available. 


Not available. 

Comments
 

 Under Construction. 

 
Categories
 



 
Free Tags 
 
 


 

Compiler output:
Main.java:9: error: class, interface, enum, or record expected
Compile Error Logs:
^
Main.java:55: error: illegal character: '#'
Case #1: 
     ^
Main.java:95: error: illegal character: '#'
Input #1 ( )
      ^
Main.java:98: error: illegal character: '#'
Output #1 ( )
       ^
4 errors
Language: C

#include <string.h>
#include <stdio.h>
 
int main(){
  static int data[1<<20];
  int i,in=0,t;
  char blood[5];
  int a=0, b=0, o=0, ab=0;
 
  memset(data,-1,sizeof(data));
  while(scanf("%d,%s",&t, blood)!=EOF){
    if(blood[0]=='A'&&blood[1]=='B') data[t] = 3;
    else if(blood[0]=='A') data[t] = 0;
    else if(blood[0]=='B') data[t] = 1;
    else if(blood[0]=='O') data[t] = 2;
    if(in < t) in= t;
    blood[0]=0; blood[1]=0;
  }
  for(i=0; i<=max_in; i++){
    if(data[i]==0) a++;
    if(data[i]==1) b++;
    if(data[i]==2) o++;
    if(data[i]==3) ab++;
  }
 
  printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:15: error: 'max_in' undeclared (first use in this function); did you mean 'main'?
   19 |   for(i=0; i<=max_in; i++){
      |               ^~~~~~
      |               main
main.c:19:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>


int main(void){
	int A=0,B=0,AB=0,O=0,i;
	char blood

	while (scanf("%d,%c",&i,&blood) != EOF){
		if(i>=50)	bleak;
		if(blood =='A')	A++;
		if(blood =='B')	B++;
		if(blood =='AB')	AB++;
		if(blood =='O')	O++;
	} 
	printf("%d\n",A);
	printf("%d\n",B);
	printf("%d\n",AB);
	printf("%d\n",O);
	return 0;

}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while'
    8 |         while (scanf("%d,%c",&i,&blood) != EOF){
      |         ^~~~~
main.c:8:34: error: 'blood' undeclared (first use in this function)
    8 |         while (scanf("%d,%c",&i,&blood) != EOF){
      |                                  ^~~~~
main.c:8:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:33: error: 'bleak' undeclared (first use in this function)
    9 |                 if(i>=50)       bleak;
      |                                 ^~~~~
main.c:12:28: warning: multi-character character constant [-Wmultichar]
   12 |                 if(blood =='AB')        AB++;
      |                            ^~~~
Language: C

#include<stdio.h>
int main(){
int x,a=0,b=0,o=0,ab=0;
char y;
while(scanf("%d,%c",&x,&y);){
switch (y){
case 'A' :a++;break;
case 'B' :b++;break;
case 'O' :o++;break;
case 'AB' :ab++;break;
}
printf("%d\n%d\n%d\n%d\n",a,b,o,ab);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:27: error: expected ')' before ';' token
    5 | while(scanf("%d,%c",&x,&y);){
      |      ~                    ^
      |                           )
main.c:10:6: warning: multi-character character constant [-Wmultichar]
   10 | case 'AB' :ab++;break;
      |      ^~~~
main.c:10:1: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   10 | case 'AB' :ab++;break;
      | ^~~~
main.c:14:1: error: expected declaration or statement at end of input
   14 | }
      | ^
Language: C

#include<stdio.h>
int main(){
int x,a=0,b=0,o=0,ab=0;
char y;
while(scanf("%d,%c",&x,&y);){
switch (y){
case 'A' :a++;break;
case 'B' :b++;break;
case 'O' :o++;break;
case 'AB' :ab++;break;
}
}
printf("%d\n%d\n%d\n%d\n",a,b,o,ab);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:27: error: expected ')' before ';' token
    5 | while(scanf("%d,%c",&x,&y);){
      |      ~                    ^
      |                           )
main.c:10:6: warning: multi-character character constant [-Wmultichar]
   10 | case 'AB' :ab++;break;
      |      ^~~~
main.c:10:1: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   10 | case 'AB' :ab++;break;
      | ^~~~
Language: C

#include <stdio.h>
int main(void)
{
    int i, n;
    char t[4];
    int c[4];
    for (i=0; i<4; ++i) c[i]=0;
    while (scanf("%d,%s", &n, t) != EOF) {
        switch (t[0]) {
            case 'A': if (t[1]=='B') c[2]++; else c[0]++; break;
            case 'B': c[1]++; break;
            case 'O': c[3]++; break;
        }
    }
    for (i=0; i<4; ++i) printf("%d\n", c[i]);
    return 0;
}
~

Compiler output:
main.c:18:1: error: expected identifier or '(' before '~' token
   18 | ~
      | ^
Language: C

int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}

Compiler output:
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
      |       ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:7: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:1:7: error: type of 'e' defaults to 'int' [-Wimplicit-int]
main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
      |                         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
      |                         ^~~~~
main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:80: error: lvalue required as increment operand
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
      |                                                                                ^~
main.c:1:96: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | int*a;main(c,d,e){for(;~scanf("%*d,%c%c",&c,&d);*(a+((d-66)?(c>68)?3:(c-65):2))++);for(e=0;e<4;printf("%d\n",a[e++]));}
      |                                                                                                ^~~~~~
main.c:1:96: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:96: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:96: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

main(){1=!puts("10\n6\n10\n0");}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){1=!puts("10\n6\n10\n0");}
      | ^~~~
main.c: In function 'main':
main.c:1:11: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | main(){1=!puts("10\n6\n10\n0");}
      |           ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | main(){1=!puts("10\n6\n10\n0");}
main.c:1:9: error: lvalue required as left operand of assignment
    1 | main(){1=!puts("10\n6\n10\n0");}
      |         ^
Language: C

main(){puts("10
6
10
0");}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){puts("10
      | ^~~~
main.c: In function 'main':
main.c:1:8: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | main(){puts("10
      |        ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | main(){puts("10
main.c:1:13: warning: missing terminating " character
    1 | main(){puts("10
      |             ^
main.c:1:13: error: missing terminating " character
    1 | main(){puts("10
      |             ^~~
main.c:2:2: error: expected ')' before numeric constant
    2 | 6
      |  ^
      |  )
    3 | 10
      | ~~
main.c:1:12: note: to match this '('
    1 | main(){puts("10
      |            ^
main.c:4:2: warning: missing terminating " character
    4 | 0");}
      |  ^
main.c:4:2: error: missing terminating " character
    4 | 0");}
      |  ^~~~
main.c:2:1: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion]
    2 | 6
      | ^
      | |
      | int
main.c:2:1: note: expected 'const char *' but argument is of type 'int'
main.c:4:1: error: expected declaration or statement at end of input
    4 | 0");}
      | ^
Language: C

import java.util.*;
import java.io.*;

public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn = null;
		Map<String, Integer> result = new LinkedHashMap<String, Integer>();
		result.put("A", 0); result.put("B", 0); result.put("AB", 0); result.put("O", 0); 
		
		try{
			stdIn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
			while( stdIn.hasNext() ){
				String str = stdIn.next();
				String[] s = str.split(",");
				Integer num = result.get(s[1]);
				result.put(s[1], num+1);
			}
			for(Integer num : result.values()){
				System.out.println(num);
			}
		} finally {
			if( stdIn != null ){
				stdIn.close();
			}
		}
	}
}

				

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main{
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main{
      |              ^~~~
Language: C

#include<stdio.h>
main(){
  int a,b,o,ab,n;
  char c[3]={'p','p','\0'};
  a=b=o=ab=0;
  while(scanf("%d,%s",&n,c) != EOF){
    if(c[0]=='A' && c[1]!='B'){
      a++;
    }
    else if(c[0]=='B'){
      b++;
    }
    else if(c[0]=='O'){
      o++;
    }
    else{
      ab++;
    }
    c[0]=c[1]=p;
  }
  printf("%d\n%d\n%d\n%d\n",a,b,o,ab);
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:19:15: error: 'p' undeclared (first use in this function)
   19 |     c[0]=c[1]=p;
      |               ^
main.c:19:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){
	int i;
	int a = 0;
	int b = 0;
	int o = 0;
	int ab = 0;
	char bld[2];
	while(scanf("%d", &i) != EOF){
		scanf("%s", &bld);
		if(bld == "AB"){
			ab++;
		}else if(bld == "O"){
			o++;
		}else if(bld == "A"){
			a++;
		}else if(bld == "b"){
			b++;
		}
	}		
	printf("%d\n %d\n %d\n %d\n", a, b ab, o);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:43: error: expected ')' before 'ab'
   22 |         printf("%d\n %d\n %d\n %d\n", a, b ab, o);
      |               ~                           ^~~
      |                                           )
Language: C

#include<stdio.h>

int main(){
	int i;
	int a = 0;
	int b = 0;
	int o = 0;
	int ab = 0;
	char bld[2];
	while(scanf("%d", &i) != EOF){
		scanf("%s", &bld);
		if(bld == "AB"){
			ab++;
		}else if(bld == "O"){
			o++;
		}else if(bld == "A"){
			a++;
		}else if(bld == "B"){
			b++;
		}
	}		
	printf("%d\n %d\n %d\n %d\n", a, b ab, o);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:43: error: expected ')' before 'ab'
   22 |         printf("%d\n %d\n %d\n %d\n", a, b ab, o);
      |               ~                           ^~~
      |                                           )
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
    int a,b,ab,o,g;
    char x[2],a;
    a=b=ab=o=0;
    while(scanf("%d%c%s",&g,x)!=EOF){
        if(x[0]=='A')(x[1]=='B')?ab++:a++;
        else if(x[0]=='B')b++;

        else o++;
    }
    printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: conflicting types for 'a'; have 'char'
    5 |     char x[2],a;
      |               ^
main.c:4:9: note: previous declaration of 'a' with type 'int'
    4 |     int a,b,ab,o,g;
      |         ^
Language: C++

#include<ios>
int cnt[4];char s[9];
main()
{
    while(~scanf("%*d,%s\n",s))
    {
        cnt[strcmp(s,"AB")?strcmp(s,"A")?strcmp(s,"B")?3:1:0:2]++;
    }
    for(int i=0;i<4;i++)printf("%d\n",cnt[i]);
}


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:13: error: 'strcmp' was not declared in this scope
    7 |         cnt[strcmp(s,"AB")?strcmp(s,"A")?strcmp(s,"B")?3:1:0:2]++;
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<ios>
  +++ |+#include <cstring>
    2 | int cnt[4];char s[9];
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,ab,o;
	char var[10];
	int now
	while (cin>>now>>var)
	{
		if (var[1]=='B')
		{
			ab++;
		}
		else if (var[0]=='A')
		{
			a++;
		}
		else if (var[0]=='B')
		{
			b++;
		}
		else if (var[0]=='O')
		{
			o++;
		}
	}
	printf("%d%d%d%d\n",a,b,ab,o );
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'while'
    8 |         while (cin>>now>>var)
      |         ^~~~~
Language: C++

#include <stdio.h>

int main(){
	int a;
	char c[10];
	int ans[4];
	ans[0] = 0;
	ans[1] = 0;
	ans[2] = 0;
	ans[3] = 0;
	while(scanf("%d,%s",&a,&c) != EOF){
		if(strcmp(c,"A") == 0){
			ans[0]++;
		}
		if(strcmp(c,"B") == 0){
			ans[1]++;
		}
		if(strcmp(c,"O") == 0){
			ans[2]++;
		}
		if(strcmp(c,"AB") == 0){
			ans[3]++;
		}
	}
	printf("%d\n%d\n%d\n%d\n",a[0],a[1],a[2],a[3]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'strcmp' was not declared in this scope
   12 |                 if(strcmp(c,"A") == 0){
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:15:20: error: 'strcmp' was not declared in this scope
   15 |                 if(strcmp(c,"B") == 0){
      |                    ^~~~~~
a.cc:15:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:18:20: error: 'strcmp' was not declared in this scope
   18 |                 if(strcmp(c,"O") == 0){
      |                    ^~~~~~
a.cc:18:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:20: error: 'strcmp' was not declared in this scope
   21 |                 if(strcmp(c,"AB") == 0){
      |                    ^~~~~~
a.cc:21:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:25:36: error: invalid types 'int[int]' for array subscript
   25 |         printf("%d\n%d\n%d\n%d\n",a[0],a[1],a[2],a[3]);
      |                                    ^
a.cc:25:41: error: invalid types 'int[int]' for array subscript
   25 |         printf("%d\n%d\n%d\n%d\n",a[0],a[1],a[2],a[3]);
      |                                         ^
a.cc:25:46: error: invalid types 'int[int]' for array subscript
   25 |         printf("%d\n%d\n%d\n%d\n",a[0],a[1],a[2],a[3]);
      |                                              ^
a.cc:25:51: error: invalid types 'int[int]' for array subscript
   25 |         printf("%d\n%d\n%d\n%d\n",a[0],a[1],a[2],a[3]);
      |                                                   ^
Language: C++

#include <stdio.h>

int main(){
	int a;
	char c[10];
	int ans[4];
	ans[0] = 0;
	ans[1] = 0;
	ans[2] = 0;
	ans[3] = 0;
	while(scanf("%d,%s",&a,&c) != EOF){
		if(strcmp(c,"A") == 0){
			ans[0]++;
		}
		if(strcmp(c,"B") == 0){
			ans[1]++;
		}
		if(strcmp(c,"O") == 0){
			ans[2]++;
		}
		if(strcmp(c,"AB") == 0){
			ans[3]++;
		}
	}
	printf("%d\n%d\n%d\n%d\n",ans[0],ans[1],ans[2],ans[3]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'strcmp' was not declared in this scope
   12 |                 if(strcmp(c,"A") == 0){
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:15:20: error: 'strcmp' was not declared in this scope
   15 |                 if(strcmp(c,"B") == 0){
      |                    ^~~~~~
a.cc:15:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:18:20: error: 'strcmp' was not declared in this scope
   18 |                 if(strcmp(c,"O") == 0){
      |                    ^~~~~~
a.cc:18:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:20: error: 'strcmp' was not declared in this scope
   21 |                 if(strcmp(c,"AB") == 0){
      |                    ^~~~~~
a.cc:21:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int ta[4];
string dx[]={"A","B","AB","O"};
int main(){
	
	int a;string b;
	while(cin>>a,a!=EOF){
	cin.ignore();cin>>b;
	for(int j=0;j<4;j++)if(b==dx[j])ta[j]++;
	}
	for(int j=0;j<4;j++)cout<<ta[j]<<endl;
	}
	return 0;
}

Compiler output:
a.cc:21:9: error: expected unqualified-id before 'return'
   21 |         return 0;
      |         ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include<stdio.h>

int main()
{

int K,TB=0,TA=0,Tab=0,TM=0;
char ch;
while(scanf("%c,%d",&ch,&K)!=EOF)
{
if(ch=="A")TA++;
else if(ch=="B")TB++;
else if(ch=="AB")Tab++;
else if(ch=="O")TM++;
}
printf("%d\n%d\n%d\n%d\n",TA,TB,Tab,TM);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 | if(ch=="A")TA++;
      |    ~~^~~~~
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | else if(ch=="B")TB++;
      |         ~~^~~~~
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | else if(ch=="AB")Tab++;
      |         ~~^~~~~~
a.cc:13:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | else if(ch=="O")TM++;
      |         ~~^~~~~
Language: C++

#include<stdio.h>
#include<string>
int main()
{
string str;
int K,TB=0,TA=0,Tab=0,TM=0;
char ch;
while(scanf("%d,%s",&K,str)!=EOF)
{
if(str=='A')TA++;
else if(str=='B')TB++;
else if(str=='AB')Tab++;
else if(str=='O')TM++;
}
printf("%d\n%d\n%d\n%d\n",TA,TB,Tab,TM);

return 0;
}

Compiler output:
a.cc:12:14: warning: multi-character character constant [-Wmultichar]
   12 | else if(str=='AB')Tab++;
      |              ^~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string str;
      | ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:24: error: 'str' was not declared in this scope; did you mean 'std'?
    8 | while(scanf("%d,%s",&K,str)!=EOF)
      |                        ^~~
      |                        std
Language: C++

#include <iostream>
#include <map>
#define FIN(V) cout<<V<<endl
int main(void){
	map<string, int> map;
	int n;
	char c;
	string s;
	while(cin >> n >> c >> s){
		map[s]++;
	}
	FIN(map["A"]);
	FIN(map["B"]);
	FIN(map["AB"]);
	FIN(map["O"]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'map' was not declared in this scope
    5 |         map<string, int> map;
      |         ^~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:5:13: error: 'string' was not declared in this scope
    5 |         map<string, int> map;
      |             ^~~~~~
a.cc:5:13: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:21: error: expected primary-expression before 'int'
    5 |         map<string, int> map;
      |                     ^~~
a.cc:8:15: error: expected ';' before 's'
    8 |         string s;
      |               ^~
      |               ;
a.cc:9:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         while(cin >> n >> c >> s){
      |               ^~~
      |               std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:32: error: 's' was not declared in this scope
    9 |         while(cin >> n >> c >> s){
      |                                ^
a.cc:3:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 | #define FIN(V) cout<<V<<endl
      |                ^~~~
a.cc:12:9: note: in expansion of macro 'FIN'
   12 |         FIN(map["A"]);
      |         ^~~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:3:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 | #define FIN(V) cout<<V<<endl
      |                         ^~~~
a.cc:12:9: note: in expansion of macro 'FIN'
   12 |         FIN(map["A"]);
      |         ^~~
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~