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

#include <iostream>
#include <map>
#include <string>
#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:6:9: error: 'map' was not declared in this scope
    6 |         map<string, int> map;
      |         ^~~
a.cc:6: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:6:13: error: 'string' was not declared in this scope
    6 |         map<string, int> map;
      |             ^~~~~~
a.cc:6: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:6:21: error: expected primary-expression before 'int'
    6 |         map<string, int> map;
      |                     ^~~
a.cc:9:15: error: expected ';' before 's'
    9 |         string s;
      |               ^~
      |               ;
a.cc:10:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         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:10:32: error: 's' was not declared in this scope
   10 |         while(cin >> n >> c >> s){
      |                                ^
a.cc:4:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 | #define FIN(V) cout<<V<<endl
      |                ^~~~
a.cc:13:9: note: in expansion of macro 'FIN'
   13 |         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:4:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | #define FIN(V) cout<<V<<endl
      |                         ^~~~
a.cc:13:9: note: in expansion of macro 'FIN'
   13 |         FIN(map["A"]);
      |         ^~~
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	
	int n;
	int b[4]={0};
	char s[4],comma;
	
	while(cin>>n>>comma>>s){
		if(strcmp(s,"A")==0)
			b[0]++;
		else if(strcmp(s,"B")==0)
			b[1]++;
		else if(strcmp(s,"AB")==0)
			b[2]++;
		else if(strcmp(s,"O")==0)
			b[3]++;
		else
			break;
	}
	for(int i=0;i<4;i++)
		cout<<b[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'strcmp' was not declared in this scope
   11 |                 if(strcmp(s,"A")==0)
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

int main(){
	
	int n;
	int b[4]={0};
	char s[4],comma;
	
	while(cin>>n>>comma>>s){
		if(strcmp(s,"A")==0)
			b[0]++;
		else if(strcmp(s,"B")==0)
			b[1]++;
		else if(strcmp(s,"AB")==0)
			b[2]++;
		else if(strcmp(s,"O")==0)
			b[3]++;
		else
			break;
	}
	for(int i=0;i<4;i++)
		cout<<b[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'strcmp' was not declared in this scope
   12 |                 if(strcmp(s,"A")==0)
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

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

int main(){
	
	int n;
	int b[4]={0};
	char s[4],comma;
	
	while(cin>>n>>comma>>s){
		if(strcmp(s,"A")==0)
			b[0]++;
		else if(strcmp(s,"B")==0)
			b[1]++;
		else if(strcmp(s,"AB")==0)
			b[2]++;
		else if(strcmp(s,"O")==0)
			b[3]++;
	}
	for(int i=0;i<4;i++)
		cout<<b[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'strcmp' was not declared in this scope
   12 |                 if(strcmp(s,"A")==0)
      |                    ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	int a;
	char b;
	string c;
	int t[4] = {0,0,0,0}
	while(cin >> a >> b >> c){
		if(c=="A") t[0]++;
		if(c=="B") t[1]++;
		if(c=="AB") t[2]++;
		if(c=="O") t[3]++;
	}
	cout << t[0] << " " << t[1] << " " << t[2] << " " << t[3] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected ',' or ';' before 'while'
    9 |         while(cin >> a >> b >> c){
      |         ^~~~~
Language: C++

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>

using namespace std;


void Solution()
{
    int n;
    
    char type;
    char comma;
    
    int a, b, ab, o = 0; //for counting the blood types
    
    
    while (cin>>n>>comma>>type)
    {
        if(type == "A")
        {
            a++;
        }
        else if(type == "B")
        {
            b++;
        }
        else if(type == "O")
        {
            o++;
        }
        else
        {
            ab++;
        }
    }
    
    cout<<a<<endl;
    cout<<b<<endl;
    cout<<ab<<endl;
    cout<<o<<endl;
}

int main()
{
    Solution();
    return 0;
}

Compiler output:
a.cc: In function 'void Solution()':
a.cc:23:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |         if(type == "A")
      |            ~~~~~^~~~~~
a.cc:27:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |         else if(type == "B")
      |                 ~~~~~^~~~~~
a.cc:31:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |         else if(type == "O")
      |                 ~~~~~^~~~~~
Language: C++

#include <string>
#include <iostream>

using namespace std;

int main()
{
	int N, B[4]; string S;

	memset(B, 0, sizeof(B));

	while (cin >> N >> S)
	{
		if (S == "A")
		{
			B[0] += 1;
		}
		else if (S == "B")
		{
			B[1] += 1;
		}
		else if (S == "AB")
		{
			B[2] += 1;
		}
		else if (S == "O")
		{
			B[3] += 1;
		}
	}

	cout << B[0] << endl << B[1] << endl << B[2] << endl << B[3] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(B, 0, sizeof(B));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 |
Language: C++

use strict;
use warnings;

my $s;
my @case = (0, 0, 0, 0);
while($s = <>) {
	chomp $s;
	my @arr = split /\,/, $s;
	if($arr[1] eq "A") {
		$case[0]++;
	} elsif($arr[1] eq "B") {
		$case[1]++;
	} elsif($arr[1] eq "AB") {
		$case[2]++;
	} elsif($arr[1] eq "O") {
		$case[3]++;
	}
}

foreach my $i (@case) {
	print "$i\n";
}

exit;

Compiler output:
a.cc:5:4: error: stray '@' in program
    5 | my @case = (0, 0, 0, 0);
      |    ^
a.cc:8:12: error: stray '@' in program
    8 |         my @arr = split /\,/, $s;
      |            ^
a.cc:8:26: error: stray '\' in program
    8 |         my @arr = split /\,/, $s;
      |                          ^
a.cc:20:16: error: stray '@' in program
   20 | foreach my $i (@case) {
      |                ^
a.cc:1:1: error: 'use' does not name a type
    1 | use strict;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use warnings;
      | ^~~
a.cc:4:1: error: 'my' does not name a type
    4 | my $s;
      | ^~
a.cc:5:1: error: 'my' does not name a type
    5 | my @case = (0, 0, 0, 0);
      | ^~
a.cc:6:1: error: expected unqualified-id before 'while'
    6 | while($s = <>) {
      | ^~~~~
a.cc:20:1: error: 'foreach' does not name a type
   20 | foreach my $i (@case) {
      | ^~~~~~~
a.cc:24:1: error: 'exit' does not name a type
   24 | exit;
      | ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | use strict;
Language: C++

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

int main(){
  int num,a[4]={};
  char c;
  string s,b[4]={"A","B","AB","O"};

  while(cin>>num>>c>>s){
      if(s==b[0]) 
	a[0]++;
      else if(s==b[1]) 
	a[1]++;
      else if(s==b[2]) 
	a[2]++;
      else a[3]++;
  }
  for(int i=0;i<4;i++)
    cout<<a[i]<<endl;
 return 0;

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

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

int main()
{
  int n;
  string str;
  int c1, c2, c3, c4
  c1 = c2 - c3 = c4 = 0;

  while (scanf("%d,%s", &n, str){
    if (str == "A"){c1++;}
    if (str == "B"){c2++;}
    if (str == "AB"){c3++;}
    if (str == "O"){c4++;}
  }
  cout << c1 << "\n" << c2 << "\n" << c3 << "\n" << c4 << endl;

  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected initializer before 'c1'
   11 |   c1 = c2 - c3 = c4 = 0;
      |   ^~
a.cc:13:33: error: expected ')' before '{' token
   13 |   while (scanf("%d,%s", &n, str){
      |         ~                       ^
      |                                 )
a.cc:17:21: error: 'c4' was not declared in this scope; did you mean 'c3'?
   17 |     if (str == "O"){c4++;}
      |                     ^~
      |                     c3
a.cc:19:53: error: 'c4' was not declared in this scope; did you mean 'c3'?
   19 |   cout << c1 << "\n" << c2 << "\n" << c3 << "\n" << c4 << endl;
      |                                                     ^~
      |                                                     c3
Language: C++

//#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MIN 39
#define MAX 150
int main(void)
{
	char c[3];
	int A = 0, B = 0, AB = 0, O = 0, x;
	while (scanf_s("%d,%s", &x, &c) != EOF) {
		if (c[0] == 'A' && c[1] == 'B') ++B;
		else if (c[0] == 'A') ++A;
		else if (c[0] == 'B') ++B;
		else if (c[0] == 'O') ++O;
	}
	printf("%d\n%d\n%d\n%d\n", A, B, AB, O);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |         while (scanf_s("%d,%s", &x, &c) != EOF) {
      |                ^~~~~~~
      |                scanf
Language: C++

#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MIN 39
#define MAX 150
int main(void)
{
	char c[3];
	int A = 0, B = 0, AB = 0, O = 0, x;
	while (scanf_s("%d,", &x) != EOF) {
		gets_s(c, 3);
		if (c[0] == 'A' && c[1] == 'B') ++AB;
		else if (c[0] == 'A') ++A;
		else if (c[0] == 'B') ++B;
		else if (c[0] == 'O') ++O;
	}
	printf("%d\n%d\n%d\n%d\n", A, B, AB, O);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'gets_s' was not declared in this scope
   15 |                 gets_s(c, 3);
      |                 ^~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	int n, a = b = o = ab = 0;
	char delim;
	string type;
	while( cin >> n >> delim >> type ){
		if ( type == "A" ) a++;
		else if ( type == "B" ) b++;
		else if ( type == "AB" ) ab++;
		else if ( type == "O" ) o++;
	}
	cout << a << endl << b << endl << ab << endl << o << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: 'b' was not declared in this scope
    5 |         int n, a = b = o = ab = 0;
      |                    ^
a.cc:5:24: error: 'o' was not declared in this scope
    5 |         int n, a = b = o = ab = 0;
      |                        ^
a.cc:5:28: error: 'ab' was not declared in this scope; did you mean 'a'?
    5 |         int n, a = b = o = ab = 0;
      |                            ^~
      |                            a
Language: C++

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

int main()
{
	char commma;
	int num;
	string blood;
	int a = 0, b = 0, ab = 0, o = 0;
	while (1) {
		cin >> num >> commma >> blood;
		if (cin.eof)break;//??\????????????????????°break
		if (blood == "A")a++;
		else if (blood == "B")b++;
		else if (blood == "AB")ab++;
		else o++;
	}
	cout << a << endl;
	cout << b << endl;
	cout << ab << endl;
	cout << o << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: cannot convert 'std::basic_ios<char>::eof' from type 'bool (std::basic_ios<char>::)() const' to type 'bool'
   14 |                 if (cin.eof)break;//??\????????????????????°break
      |                            ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int s[50];
	string str[50];
	int i = 0;
	int a, b, ab, o = 0;
	while (scanf_s("%d,%s", s[i], str[i])) {
		i++;
		if (str[i] == "A") {
			a++;
		}
		else if (str[i] == "B") {
			b++;
		}
		else if (str[i] == "AB") {
			ab++;
		}
		else if (str[i] == "O") {
			o++;
		}
	}
	cout << a << endl;
	cout << b << endl;
	cout << ab << endl;
	cout << o << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         while (scanf_s("%d,%s", s[i], str[i])) {
      |                ^~~~~~~
      |                scanf
Language: C++

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

int main(){
  int num;int blood_a=0,blood_b=0,blood_ab=0,blood_o=0;
  char blood_type[3];
  while(scanf("%d,%s",&num,blood_type)){
      if(blood_type=='A')blood_a++;
      else if(blood_type='B')blood_b++;
      else if(blood_type="AB")blood_ab++;
      else if(blood_type='O')blood_o++;
  }
  cout<<blood_a<<endl<<blood_b<<endl<<blood_ab<<endl<<blood_o<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |       if(blood_type=='A')blood_a++;
      |          ~~~~~~~~~~^~~~~
a.cc:11:25: error: incompatible types in assignment of 'char' to 'char [3]'
   11 |       else if(blood_type='B')blood_b++;
      |               ~~~~~~~~~~^~~~
a.cc:12:25: error: invalid array assignment
   12 |       else if(blood_type="AB")blood_ab++;
      |               ~~~~~~~~~~^~~~~
a.cc:13:25: error: incompatible types in assignment of 'char' to 'char [3]'
   13 |       else if(blood_type='O')blood_o++;
      |               ~~~~~~~~~~^~~~
Language: C++

#include <cstdio>
using namespace std;

int main() {
	int A=0,B=0,C=0,D=0;
	int num;
	char bl;
	while (scanf("%d, %c",num,bl)!=EOF) {
		switch(bl) {
			case 'A':
				A++;
				break;
			case 'B';
				B++;
				break;
			case 'AB':
				AB++;
				break;
			case 'O':
				O++;
				break;
		}
	}
	printf("%d\n%d\n%d\n%d\n",A,B,AB,O);
}

Compiler output:
a.cc:16:30: warning: multi-character character constant [-Wmultichar]
   16 |                         case 'AB':
      |                              ^~~~
a.cc: In function 'int main()':
a.cc:13:33: error: expected ':' before ';' token
   13 |                         case 'B';
      |                                 ^
      |                                 :
a.cc:17:33: error: 'AB' was not declared in this scope; did you mean 'B'?
   17 |                                 AB++;
      |                                 ^~
      |                                 B
a.cc:20:33: error: 'O' was not declared in this scope
   20 |                                 O++;
      |                                 ^
a.cc:16:25: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   16 |                         case 'AB':
      |                         ^~~~
a.cc:24:39: error: 'AB' was not declared in this scope; did you mean 'B'?
   24 |         printf("%d\n%d\n%d\n%d\n",A,B,AB,O);
      |                                       ^~
      |                                       B
a.cc:24:42: error: 'O' was not declared in this scope
   24 |         printf("%d\n%d\n%d\n%d\n",A,B,AB,O);
      |                                          ^
Language: C++

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

int main() {
	int A=0,B=0,C=0,D=0;
	int num;
	string bl;
	while (scanf("%d, %s",num,bl)!=EOF) {
		switch(bl) {
			case "A":
				A++;
				break;
			case "B":
				B++;
				break;
			case "AB":
				C++;
				break;
			case "O":
				D++;
				break;
		}
	}
	printf("%d\n%d\n%d\n%d\n",A,B,C,D);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: switch quantity not an integer
   10 |                 switch(bl) {
      |                        ^~
Language: C++

char a[999],b,c[9];
main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);}
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:13: error: 'scanf' was not declared in this scope
    2 | main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);}
      |             ^~~~~
a.cc:2:49: error: 'printf' was not declared in this scope
    2 | main(){for(;scanf("%d,%s",&b,c)+1;a[*c+c[1]]++);printf("%d\n%d\n%d\n%d\n",a[65],a[66],a[131],a[79]);}
      |                                                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | char a[999],b,c[9];
Language: C++

char s[9];a[4];main(i){for(;~scanf("%*d,%s");)a[*s-65?*s-66?2:3:s[1]?4:1]++;for(;i<5;)printf("%d\n",a[i]);return 0;}

Compiler output:
a.cc:1:11: error: 'a' does not name a type
    1 | char s[9];a[4];main(i){for(;~scanf("%*d,%s");)a[*s-65?*s-66?2:3:s[1]?4:1]++;for(;i<5;)printf("%d\n",a[i]);return 0;}
      |           ^
a.cc:1:20: error: expected constructor, destructor, or type conversion before '(' token
    1 | char s[9];a[4];main(i){for(;~scanf("%*d,%s");)a[*s-65?*s-66?2:3:s[1]?4:1]++;for(;i<5;)printf("%d\n",a[i]);return 0;}
      |                    ^
Language: C++

c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d\n",c[7],c[2],c[1],*c);}

Compiler output:
a.cc:1:1: error: 'c' does not name a type
    1 | c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d\n",c[7],c[2],c[1],*c);}
      | ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
    1 | c[];main(b){for(;~scanf("%d%s",&b,&b);++c[b%9]);printf("%d\n%d\n%d\n%d\n",c[7],c[2],c[1],*c);}
      |         ^
Language: C++

main(a,b,c,d,e){printf("%d\n%d\n%d\n%d\n",b%10,c%10,d%10,e%10);}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(a,b,c,d,e){printf("%d\n%d\n%d\n%d\n",b%10,c%10,d%10,e%10);}
      |     ^
Language: C++

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

Compiler output:
a.cc:1:1: error: 'x' does not name a type
    1 | x;main(){x=!puts("10\n6\n10\n0");}
      | ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | x;main(){x=!puts("10\n6\n10\n0");}
      |   ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'x' was not declared in this scope
    1 | x;main(){x=!puts("10\n6\n10\n0");}
      |          ^
a.cc:1:13: error: 'puts' was not declared in this scope
    1 | x;main(){x=!puts("10\n6\n10\n0");}
      |             ^~~~
Language: C++

main(){printf("10\n6\n10\n0");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){printf("10\n6\n10\n0");}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'printf' was not declared in this scope
    1 | main(){printf("10\n6\n10\n0");}
      |        ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){printf("10\n6\n10\n0");}
Language: C++

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

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a;main(){a=!puts("10\n6\n10\n0");}
      | ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | a;main(){a=!puts("10\n6\n10\n0");}
      |   ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'a' was not declared in this scope
    1 | a;main(){a=!puts("10\n6\n10\n0");}
      |          ^
a.cc:1:13: error: 'puts' was not declared in this scope
    1 | a;main(){a=!puts("10\n6\n10\n0");}
      |             ^~~~
Language: C++

#include<cstdio>

using namespace std;

int answer[4]={0};

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:41: error: expected ';' before ':' token
   20 |                 printf("%d\n",answer[i]):;
      |                                         ^
      |                                         ;
Language: C++

#include <iostream>
using namespace std;

int main()
{
 int x,y,z,a,b,ab,o;
 char w,v,q;
 while(cin>>x>>w>>v)
 {
  if(v == A)a++;
  else if(v==B){b++;}
  else if(v==AB){ab++;}
  else (v==o){o++;}
  }
cout<<a<<endl;
cout<<b<<endl;
cout<<ab<<endl;
cout<<o<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'A' was not declared in this scope
   10 |   if(v == A)a++;
      |           ^
a.cc:11:14: error: 'B' was not declared in this scope
   11 |   else if(v==B){b++;}
      |              ^
a.cc:12:14: error: 'AB' was not declared in this scope; did you mean 'ab'?
   12 |   else if(v==AB){ab++;}
      |              ^~
      |              ab
a.cc:13:14: error: expected ';' before '{' token
   13 |   else (v==o){o++;}
      |              ^
      |              ;
Language: C++

#include <iostream>
using namespace std;

int main()
{
 int x,y,z,a,b,ab,o;
 char w,v,q;
 while(cin>>x>>w>>v)
 {
  if(v == A;)a++;
  else if(v==B;){b++;}
  else if(v==AB;){ab++;}
  else (v==o;){o++;}
  }
cout<<a<<endl;
cout<<b<<endl;
cout<<ab<<endl;
cout<<o<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'A' was not declared in this scope
   10 |   if(v == A;)a++;
      |           ^
a.cc:10:13: error: expected primary-expression before ')' token
   10 |   if(v == A;)a++;
      |             ^
a.cc:11:14: error: 'B' was not declared in this scope
   11 |   else if(v==B;){b++;}
      |              ^
a.cc:11:16: error: expected primary-expression before ')' token
   11 |   else if(v==B;){b++;}
      |                ^
a.cc:12:14: error: 'AB' was not declared in this scope; did you mean 'ab'?
   12 |   else if(v==AB;){ab++;}
      |              ^~
      |              ab
a.cc:12:17: error: expected primary-expression before ')' token
   12 |   else if(v==AB;){ab++;}
      |                 ^
a.cc:13:13: error: expected ')' before ';' token
   13 |   else (v==o;){o++;}
      |        ~    ^
      |             )
a.cc:13:14: error: expected primary-expression before ')' token
   13 |   else (v==o;){o++;}
      |              ^
Language: C++

#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:
a.cc:22:3: error: expected declaration before '}' token
   22 | };}
      |   ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <map>

using namespace std;

int main() {
	int num;
	string row, blood;
	map<string, int> type;
	type.insert(make_pair("A", 0));
	type.insert(make_pair("B", 0));
	type.insert(make_pair("O", 0));
	type.insert(make_pair("AB", 0));
	while(cin>>row, !cin.eof()){
		sscanf(row,"%d,%s", &num, &blood)
			type[blood]++;
	}
	cout<<type["A"]<<endl;
	cout<<type["B"]<<endl;
	cout<<type["O"]<<endl;
	cout<<type["AB"]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   17 |                 sscanf(row,"%d,%s", &num, &blood)
      |                        ^~~
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdio.h:430:43: note:   initializing argument 1 of 'int sscanf(const char*, const char*, ...)'
  430 | extern int sscanf (const char *__restrict __s,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <map>

using namespace std;

int main() {
	int num;
	string row, blood;
	map<string, int> type;
	type.insert(make_pair("A", 0));
	type.insert(make_pair("B", 0));
	type.insert(make_pair("O", 0));
	type.insert(make_pair("AB", 0));
	while(cin>>row, !cin.eof()){
		sscanf(row,"%d,%s", &num, &blood);
		type[blood]++;
	}
	cout<<type["A"]<<endl;
	cout<<type["B"]<<endl;
	cout<<type["O"]<<endl;
	cout<<type["AB"]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   17 |                 sscanf(row,"%d,%s", &num, &blood);
      |                        ^~~
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdio.h:430:43: note:   initializing argument 1 of 'int sscanf(const char*, const char*, ...)'
  430 | extern int sscanf (const char *__restrict __s,
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

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

int main(){
  char blood[3];
  int num,a=0,b=0,o=0,ab=0;
  while(scanf("%d,%s",&num,blood) != EOF){
    if(blood[0] == 'A' && blood[1] == '\0'){
      a++;
    }
    else if(blood[0] == 'B'){
      b++;
    }
    else if(blood[0] == 'O'){
      o++;
    }
    else if(strcmp(blood,"AB") == 0){
      ab++;
    }
  }
  cout << a << endl << b << endl << ab << endl << o << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'strcmp' was not declared in this scope
   19 |     else if(strcmp(blood,"AB") == 0){
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #include <string>
Language: Java

import java.io.*;

public class Main {
  public Main() {
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      String str = br.readLine();
      System.out.println(str.replace("apple", "xxxxx").replace("peach", "apple").replace("xxxxx", "peach"));
      br.close()
    } catch(IOException e) {
      System.out.println(e.getMessage());
    }
  }

  public static void main(String[] args) {
    new Main();
  }
}

Compiler output:
Main.java:9: error: ';' expected
      br.close()
                ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
????????????public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		str = str.replaceAll("apple", "aaaaa");
		str = str.replaceAll("peach", "apple");
		str = str.replaceAll("aaaaa", "peach");
		System.out.println(str);
	}
}

Compiler output:
Main.java:3: error: illegal start of type
????????????public static void main(String[] args) {
^
1 error
Language: Java

import java.util.*;
class Main{
????????????public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		str = str.replaceAll("apple", "aaaaa");
		str = str.replaceAll("peach", "apple");
		str = str.replaceAll("aaaaa", "peach");
		System.out.println(str);
	}
}

Compiler output:
Main.java:3: error: illegal start of type
????????????public static void main(String[] args) {
^
1 error
Language: Java

/*
  正規表現は、[〇〇]を文字列形式で与える！！
 */
import java.util.*;
public class Main0050{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	String s = "";     // 生成中単語
	String x;          // 取得1文字
	String sent = "";  // 出力文章
	String in = kbd.nextLine(); // 入力文章

	int i;
	for(i=0; i<in.length(); i++){
	    x = in.substring(i, i+1);
	    if(!x.matches("[a-zA-Z]")){
		//System.out.println(x);
		if(s.equals("apple")){
		    s = "peach";
		}
		else if(s.equals("peach")){
		    s = "apple";
		}
		sent += (s+x);
		s = "";
	    }
	    else{
		s += x;
	    }
	}

	System.out.println(sent);
    }
}

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

import java.util.*;
public class Main{
    Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	new Main0050().run();
    }

    void run(){
	while(kbd.hasNext()){
	    String x;          // 取得1文字
	    StringBuffer sent = new StringBuffer();  // 出力文章
	    String in = kbd.nextLine(); // 入力文章
	    
	    int i;
	    for(i=0; i<in.length(); i++){
		x = in.substring(i, i+1);
		if(x.equals("a") || x.equals("p")){
		    for(int k=0; k<4; k++){
			i++;
			x += in.substring(i, i+1);
		    }
		    if(x.equals("apple")){
			sent.append("peach");
		    }
		    else if(x.equals("peach")){
			sent.append("apple");
		    }
		    else sent.append(x);
		}
		else sent.append(x);
	    }
		
	    System.out.println(sent);
	}
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
	new Main0050().run();
	    ^
  symbol:   class Main0050
  location: class Main
1 error
Language: Java

public class AppleAndPeach {
	
	public static void main(String args[]) throws Exception {

		System.out.println("input letters >");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        
        String output = input.replaceAll("peach","value");
        
        output = output.replaceAll("apple", "peach");
        
        output = output.replaceAll("value", "apple");
        
        System.out.println(output);

	}

}

Compiler output:
Main.java:1: error: class AppleAndPeach is public, should be declared in a file named AppleAndPeach.java
public class AppleAndPeach {
       ^
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class AppleAndPeach
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class AppleAndPeach
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class AppleAndPeach
4 errors
Language: Java

public class Main {
	
	public static void main(String args[]) throws Exception {

		System.out.println("input letters >");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        
        String output = input.replaceAll("peach","value");
        
        output = output.replaceAll("apple", "peach");
        
        output = output.replaceAll("value", "apple");
        
        System.out.println(output);

	}

}

Compiler output:
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

public class Main {
	
	public static void Main(String args[]) throws Exception {

		System.out.println("input letters >");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        
        String output = input.replaceAll("peach","value");
        
        output = output.replaceAll("apple", "peach");
        
        output = output.replaceAll("value", "apple");
        
        System.out.println(output);

	}

}

Compiler output:
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:6: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

public class main {
	public static void main(String args[]) throws Exception {
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		
		String line;

		for(int i=0; i<Integer.parseInt(bn.readLine()); i++){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			line = br.readLine();
			String str1 = line.replaceAll("apple", "テンプ");
			String str2 = str1.replaceAll("peach", "apple");
			String str3 = str2.replaceAll("テンプ", "peach");
	        System.out.println(str3);
		}
	}
}

Compiler output:
Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class main
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class main
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			^
  symbol:   class BufferedReader
  location: class main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                        ^
  symbol:   class BufferedReader
  location: class main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                                           ^
  symbol:   class InputStreamReader
  location: class main
7 errors
Language: Java

public class Main {
	public static void main(String args[]) {
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		
		String line;

		for(int i=0; i<Integer.parseInt(bn.readLine()); i++){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			line = br.readLine();
			String str1 = line.replaceAll("apple", "テンプ");
			String str2 = str1.replaceAll("peach", "apple");
			String str3 = str2.replaceAll("テンプ", "peach");
	        System.out.println(str3);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:3: error: cannot find symbol
		BufferedReader bn = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			^
  symbol:   class BufferedReader
  location: class Main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:8: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			                                           ^
  symbol:   class InputStreamReader
  location: class Main
6 errors
Language: Java

public static void Main(String args[]) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    sentence = br.readLine();
    
    sentence = sentence.replaceAll("peach","リンゴ");
    sentence = sentence.replaceAll("apple","peach");
    sentence = sentence.replaceAll("リンゴ","apple");
    
    System.out.println(sentence);
}

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

public class Main {

	public static void main(String args[]) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line=br.readLine();
		line = line.replace("apple","fujita-");
		line = line.replace("peach","ikeda-");
		line = line.replace("fujita-","peach");
		line = line.replace("ikeda-","apple");
		System.out.println(line);
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:4: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

public class Main {
	public static void main(String args[]) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		line = br.readLine();
		String str1 = line.replaceAll("apple", "テンプ");
		String str2 = str1.replaceAll("peach", "apple");
		String str3 = str2.replaceAll("テンプ", "peach");
        System.out.println(str3);
	}
}

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

public class Main {
    private static String sentence;
    
    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        sentence = br.readLine();
        
        sentence = sentence.replaceAll("peach","リンゴ");
        sentence = sentence.replaceAll("apple","peach");
        sentence = sentence.replaceAll("リンゴ","apple");
        
        System.out.println(sentence);
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                   ^
  symbol:   class InputStreamReader
  location: class Main
3 errors
Language: Java

package tips;

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

public class AandP {

	   public static void main(String args[]) throws Exception {
	        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String line = br.readLine();
	        line = line.replaceAll("apple", "XXXXX");  
	        line = line.replaceAll("peach", "yyyyy");  
	        line = line.replaceAll("XXXXX", "peach");  
	        line = line.replaceAll("yyyyy", "apple");         
	   System.out.println(line);
	   }
}

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

#include <stdio.h>
int main(void){
	char str[1000];
	int i;
	int l;
	scanf("%s",str));
	l=strlen(str);
	for(i=0;i<=l;i++){
		if(str[i]=='a' && str[i+1]=='p' && str[i+2]=='p' && str[i+3]=='l' && str[i+4]=='e'){
			str[i]='p';
			str[i+1]='e';
			str[i+2]='a';
			str[i+3]='c';
			str[i+4]='h';
		}
		else if(str[i]=='p' && str[i+1]=='e' && str[i+2]=='a' && str[i+3]=='c' && str[i+4]=='h'){
			str[i]='a';
			str[i+1]='p';
			str[i+2]='p';
			str[i+3]='l';
			str[i+4]='e';
		}

 
		
printf("%c",str[i]);
	}  
	printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:6:24: error: expected ';' before ')' token
    6 |         scanf("%s",str));
      |                        ^
      |                        ;
main.c:6:24: error: expected statement before ')' token
main.c:7:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    7 |         l=strlen(str);
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | int main(void){
main.c:7:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    7 |         l=strlen(str);
      |           ^~~~~~
main.c:7:11: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

// AOJ Volume 0 Problem 0050

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

int main(void)
{
    char str_in[2000];
    char str_out[2000];
    char *p_in, *p_out;
    
    gets(str_in, 2000, stdin);

    str_out[0] = '\0';
    p_in = str_in;
    p_out = str_out;

    while (*p_in != '\0'){
        if (strncmp(p_in, "apple", strlen("apple")) == 0){
            strcat(p_out, "peach");
            p_out += 5;
            p_in += 5;
        }
        else if (strncmp(p_in, "peach", strlen("peach")) == 0){
            strcat(p_out, "apple");
            p_out += 5;
            p_in += 5;
        }
        else {
            *p_out++ = *p_in++;
        }
    }
    *p_out = '\0';

    printf("%s", str_out);

	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:12:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   12 |     gets(str_in, 2000, stdin);
      |     ^~~~
      |     fgets
Language: C

package solve;
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = "" , all = "";
		boolean Eflag = false;
		while ( sc.hasNext() ) {
			str = sc.next();
			String tmp = "";
			char c;
			for ( int i = 0; i < str.length(); i++ ) {
				c = str.charAt(i);
				if ( c != '.' )
					tmp += str.charAt(i);
				else  Eflag = true;
			}
			if ( tmp.equals("apple"))
				tmp = "peach";
			else if ( tmp.equals("peach") )
				tmp = "apple";
			if ( Eflag == true ) all += tmp+".";
			else all += tmp+" ";
			System.out.println(all);
		}
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'package'
    1 | package solve;
      | ^~~~~~~
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
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>

int main()
{
	char str[1000];
	int i=0;
	
	gets(str);
	
	while(str[i+4]!='\0')
	{
		if(str[i]=='a')
		{
			if(str[i+1]=='p')
			{
				if(str[i+2]=='p')
				{
					if(str[i+3]=='l')
					{
						if(str[i+4]=='e')
						{
							str[i]='p';
							str[i+1]='e';
							str[i+2]='a';
							str[i+3]='c';
							str[i+4]='h';
						}
					}
				}
			}
		}
		else if(str[i]=='p')
		{
			if(str[i+1]=='e')
			{
				if(str[i+2]=='a')
				{
					if(str[i+3]=='c')
					{
						if(str[i+4]=='h')
						{
							str[i]='a';
							str[i+1]='p';
							str[i+2]='p';
							str[i+3]='l';
							str[i+4]='e';
						}
					}
				}
			}
		}
		i++;
	}

	printf("%s",str);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |         gets(str);
      |         ^~~~
      |         fgets