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


#include <string.h>

int main(void)
{
	char str[100000];
	int i, j;
	int jcnt, icnt;
	char str1[4];

	while (scanf("%s", str) != EOF){

	
	jcnt = 0;

	for (i = 0; i < strlen(str) - 2; i++){

		if (str[i] == 'J' && str[i + 1] == 'O' && str[i + 2] == 'I'){
			jcnt++;
		}
	}

	icnt = 0;
	for (i = 0; i < strlen(str) - 2; i++){
		if (str[i] == 'I' && str[i + 1] == 'O' && str[i + 2] == 'I'){
			icnt++;
		}
	}

	}

	printf("%d\n", jcnt);
	printf("%d\n", icnt);


	return (0);
}
		

		

Compiler output:
main.c: In function 'main':
main.c:11:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |         while (scanf("%s", str) != EOF){
      |                ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <string.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:11:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |         while (scanf("%s", str) != EOF){
      |                ^~~~~
main.c:11:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:36: error: 'EOF' undeclared (first use in this function)
   11 |         while (scanf("%s", str) != EOF){
      |                                    ^~~
main.c:11:36: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:11:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   32 |         printf("%d\n", jcnt);
      |         ^~~~~~
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(void){
inj++;int counti,countj;
char a[10000];

while(scanf("%s",a)!=EOF){
counti=0;
countj=0;
for(i=0;a[i]!='\0';i++){
if(a[i+1]=='O'&&a[i+2]=='I'){
if(a[i]=='I')counti++;
if(a[i]=='J')countj++;
}
}
printf("%d\n%d\n",counti,countj);
}
return 0;}

Compiler output:
main.c: In function 'main':
main.c:3:1: error: 'inj' undeclared (first use in this function); did you mean 'int'?
    3 | inj++;int counti,countj;
      | ^~~
      | int
main.c:3:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:5: error: 'i' undeclared (first use in this function)
    9 | for(i=0;a[i]!='\0';i++){
      |     ^
Language: C

#include<stdio.h>
int main(void){
int counti,countj;
char a[10000];

while(scanf("%s",a)!=EOF){
counti=0;
countj=0;
for(i=0;a[i]!='\0';i++){
if(a[i+1]=='O'&&a[i+2]=='I'){
if(a[i]=='I')counti++;
if(a[i]=='J')countj++;
}
}
printf("%d\n%d\n",counti,countj);
}
return 0;}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'i' undeclared (first use in this function)
    9 | for(i=0;a[i]!='\0';i++){
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int main(void) {
	int i,joi,ioi = 0;
	char s[11000];
	while (scanf("%s",s) != EOF){
		joi = 0;
		ioi = 0;
		for(i = 0;i <= 10997;i++){
			if(s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I'){
				joi++;
			}
			if(s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I'){
				ioi++;
			}
		}
		printf("%d\n%d\n",joi,ioi);
		for (i = 0;i <= 10999;i++){
			s[i] = '0';
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         while (scanf("%s",s) != EOF){
      |                ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void) {
main.c:4:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         while (scanf("%s",s) != EOF){
      |                ^~~~~
main.c:4:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:33: error: 'EOF' undeclared (first use in this function)
    4 |         while (scanf("%s",s) != EOF){
      |                                 ^~~
main.c:4:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |                 printf("%d\n%d\n",joi,ioi);
      |                 ^~~~~~
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(){
char ch[100001];
int i=0,joi=0,ioi=0;
while(1){
scanf("%s",&ch);
if(ch[0]=='')break;

for(i=0;;i++){
if(ch[i]==EOF)break;
if(ch[i]=='J' &&  ch[i+1]=='O' && ch[i+2]=='I'){
joi++;
}
if(ch[i]=='I' &&  ch[i+1]=='O' && ch[i+2]=='I'){
ioi++;
}
}
printf("%d\n%d\n",joi,ioi);
}

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:11: error: empty character constant
    7 | if(ch[0]=='')break;
      |           ^~
Language: C

#include <iostream>
#include <map>
#include <algorithm>

using namespace std;

const int N = 80;
int ans[N] = { 0 };
int damari[N] = { 0 };
map<int, bool> amari;

int main(){
	int p, q, r, c, i;
	bool loop;
	while(cin >> p >> q){
		loop = false;
		p *= 10;
		for(i = 0;i < N;++i){
			c = 0;
			while(p >= q){
				p -= q;
				++c;
			}
			ans[i] = c;
			if(p == 0) break;
			damari[i] = p;
			if(amari[p]){
				loop = true;
				break;
			}
			else{
				amari[p] = true;
			}
			p *= 10;
		}
		for(int j = 0;j < i + 1;++j){
			cout << ans[j];
		}
		cout << endl;
		// ハット処理
		if(loop){
			bool hflag = false;
			for(int j = 0;j <= i;++j){
				if(hflag){
					cout << "^";
				}
				else{
					if(damari[j] == damari[i]){
						hflag = true;
					}
					cout << " ";
				}
			}
			cout << endl;
		}
		amari.clear();
	}
	return 0;
}

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

#include <stdio.h>

int main(void)
{
  char a[10001]={}; 
  while(scanf("%s",a)!=EOF){
    int j=0,i=0;
    int n;
    l=strlen(a);
    for(n=0;n<l-2;n++){
      if(a[n]=='J'&&a[n+1]=='O'&&a[n+2]=='I')
	j++;
      if(a[n]=='I'&&a[n+1]=='O'&&a[n+2]=='I')
	i++;
    }
    printf("%d\n%d\n",j,i);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'l' undeclared (first use in this function)
    9 |     l=strlen(a);
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    9 |     l=strlen(a);
      |       ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:9:7: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    9 |     l=strlen(a);
      |       ^~~~~~
main.c:9:7: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
  char a[10001]={}; 
  while(scanf("%s",a)!=EOF){
    int j=0,i=0;
    int n;
    l=strlen(a);
    for(n=0;n<l-2;n++){
      if(a[n]=='J'&&a[n+1]=='O'&&a[n+2]=='I')
	j++;
      if(a[n]=='I'&&a[n+1]=='O'&&a[n+2]=='I')
	i++;
    }
    printf("%d\n%d\n",j,i);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'l' undeclared (first use in this function)
    9 |     l=strlen(a);
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main()
{   
		char str[10001];
		int i = 0, j = 0, a;
		while (scanf_s("%s", str) == 1) {
		for (a = 0;str[a] != '\0';a++) {
			if (str[a] == 'J'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
				i++;
		}
		for (a = 0;str[a] != '\0';a++) {
			if (str[a] == 'I'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
				j++;
		}

		printf("%d\n %d\n", i, j);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:24: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |                 while (scanf_s("%s", str) == 1) {
      |                        ^~~~~~~
      |                        scanf
Language: C

#include <stdio.h>

int main()
{   
		char str[10001];
		int i = 0, j = 0, a;
		while (scan("%s", str) == 1) {
		for (a = 0;str[a] != '\0';a++) {
			if (str[a] == 'J'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
				i++;
		}
		for (a = 0;str[a] != '\0';a++) {
			if (str[a] == 'I'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
				j++;
		}

		printf("%d\n %d\n", i, j);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:24: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |                 while (scan("%s", str) == 1) {
      |                        ^~~~
      |                        scanf
Language: C

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

int main(){

int i,k,kai;
char a[1000],x[1000];

while(1){
scanf("%s",a);
if(a=="EOF")break;

for(i=0;i<strlen(a)-2;i++){
    strcopy(x,a,3);
    if(x=="IOI"||x=="JOI")kai++;

}


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


}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'strcopy'; did you mean 'strcpy'? [-Wimplicit-function-declaration]
   14 |     strcopy(x,a,3);
      |     ^~~~~~~
      |     strcpy
Language: C

#include<stdio.h>
int main(void)
{
	char n[10001],j={'J'},o={'O'},i={'I'},h={'I'};
	int a=0,b=0,i=0,c;
	scanf("%s",n);
	while(n[i]!='\0'){
		i+=1;
	}
	for(c=0;c<i;c++){
		if(n[c]==j){
			if(n[c+1]==o){
				if(n[c+2==i]){
					a+=1;
				}
			}
		}
		else if(n[c]==h){
			if(n[c+1]==o){
				if(n[c+2]==h){
					b+=1;
				}
			}
		}
	}
	printf("%d\n%d\n",a,b);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:21: error: conflicting types for 'i'; have 'int'
    5 |         int a=0,b=0,i=0,c;
      |                     ^
main.c:4:39: note: previous definition of 'i' with type 'char'
    4 |         char n[10001],j={'J'},o={'O'},i={'I'},h={'I'};
      |                                       ^
Language: C

#include<stdio.h>
int main(void)
{
	while(1){
	char n[10001],j={'J'},o={'O'},i={'I'},h={'I'};
	int a=0,b=0,i=0,c;
	if(scanf("%s",n)==EOF){
		break;
	}
	while(n[i]!='\0'){
		i+=1;
	}
	for(c=0;c<i;c++){
		if(n[c]==j){
			if(n[c+1]==o){
				if(n[c+2==i]){
					a+=1;
				}
			}
		}
		else if(n[c]==h){
			if(n[c+1]==o){
				if(n[c+2]==h){
					b+=1;
				}
			}
		}
	}
	printf("%d\n%d\n",a,b);
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:21: error: conflicting types for 'i'; have 'int'
    6 |         int a=0,b=0,i=0,c;
      |                     ^
main.c:5:39: note: previous definition of 'i' with type 'char'
    5 |         char n[10001],j={'J'},o={'O'},i={'I'},h={'I'};
      |                                       ^
Language: C

#include<iostream>
#include<stdio.h>
int main(){
	char c;
	int a=0,b=0,d=0,f=0;
	while(scanf("%c",&c)!=EOF){
		if(c=='\n'){
			printf("%d\n%d\n",a,b);
			a=0;
			b=0;
		}
		else{
			if(c=='J'){
				if(0==d){
					d++;
				}
				f=0;
			}
			else if(c=='O'){
				if(d==1){
					d++;
				}
				else d=0;
				if(f==1){
					f++;
				}
				else f=0;
			}
			else if(c=='I'){
				if(d==2){
					a++;
					d=0;
				}
				else d=0;
				if(f==0){
					f++;
				}
				else if(f==2){
					b++;
					f=1;
				}
				else f=0;
			}
			else{
				d=0;
				f=0;
			}
		}
	}
}


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

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

int main(){
	char str[1000], *p;
	
	while ( scanf( "%s", str) == 1 ){
		int i = 0;
		
		for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){
			i++;
		}
		printf("%d\n", i);
		for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){
			i++;
		}
		printf("%d\n", j, i);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:51: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   10 |                 for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){
      |                                                   ^~
main.c:10:49: note: did you mean to dereference the pointer?
   10 |                 for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){
      |                                                 ^
main.c:14:51: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   14 |                 for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){
      |                                                   ^~
main.c:14:49: note: did you mean to dereference the pointer?
   14 |                 for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){
      |                                                 ^
main.c:17:32: error: 'j' undeclared (first use in this function)
   17 |                 printf("%d\n", j, i);
      |                                ^
main.c:17:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
int j=0;ai=0;
int i;
char moji[10001]={'\0'};

while(1){
scanf("%s",moji);
if(moji==EOF)break;
j=0;
ai=0;
for(i=0;moji[i+2]!='\0';i++){
if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){
j++;
}
else if(moji[i]==I && moji[i+1]==O && moji[i+2]==I){
ai++;
}
}
printf("%d\n",j);
printf("%d\n",ai);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: 'ai' undeclared (first use in this function)
    4 | int j=0;ai=0;
      |         ^~
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:8: warning: comparison between pointer and integer
   10 | if(moji==EOF)break;
      |        ^~
main.c:14:13: error: 'J' undeclared (first use in this function)
   14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){
      |             ^
main.c:14:29: error: 'O' undeclared (first use in this function)
   14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){
      |                             ^
main.c:14:45: error: 'I' undeclared (first use in this function)
   14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){
      |                                             ^
Language: C++

#include<utility>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<stack>

using namespace std;

//AOJ IOI

int main(){
	while(true){
		string S;
		cin >> S;
		if(S == "EOF") break;

		int JOI = 0, IOI = 0;
		for(int i=0; i<S.size(); i++){
			if(S[i] == 'J'){
				if(S[i+1] == 'O'){
					if(S[i+2] == 'I'){
						JOI++;
					}
				}
			}
			if(S[i] == 'I'){
				if(S[i+1] == 'O'){
					if(S[i+2] == 'I'){
						IOI++;
					}
				}
			}
		}

		cout << JOI << endl << IOI << endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'string' was not declared in this scope
   14 |                 string S;
      |                 ^~~~~~
a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    6 | #include<stack>
  +++ |+#include <string>
    7 | 
a.cc:15:17: error: 'cin' was not declared in this scope
   15 |                 cin >> S;
      |                 ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include<stack>
  +++ |+#include <iostream>
    7 | 
a.cc:15:24: error: 'S' was not declared in this scope
   15 |                 cin >> S;
      |                        ^
a.cc:36:17: error: 'cout' was not declared in this scope
   36 |                 cout << JOI << endl << IOI << endl;
      |                 ^~~~
a.cc:36:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:32: error: 'endl' was not declared in this scope
   36 |                 cout << JOI << endl << IOI << endl;
      |                                ^~~~
a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    6 | #include<stack>
  +++ |+#include <ostream>
    7 |
Language: C++

#include<algorithm>
#include<queue>
#include<stack>

using namespace std;

//AOJ IOI

int main(){
	while(true){
		string S;
		cin >> S;
		if(S == "EOF") break;

		int JOI = 0, IOI = 0;
		for(int i=0; i<S.size(); i++){
			if(S[i] == 'J'){
				if(S[i+1] == 'O'){
					if(S[i+2] == 'I'){
						JOI++;
					}
				}
			}
			if(S[i] == 'I'){
				if(S[i+1] == 'O'){
					if(S[i+2] == 'I'){
						IOI++;
					}
				}
			}
		}

		cout << JOI << endl << IOI << endl;
	}

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'string' was not declared in this scope
   11 |                 string S;
      |                 ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include<stack>
  +++ |+#include <string>
    4 | 
a.cc:12:17: error: 'cin' was not declared in this scope
   12 |                 cin >> S;
      |                 ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<stack>
  +++ |+#include <iostream>
    4 | 
a.cc:12:24: error: 'S' was not declared in this scope
   12 |                 cin >> S;
      |                        ^
a.cc:33:17: error: 'cout' was not declared in this scope
   33 |                 cout << JOI << endl << IOI << endl;
      |                 ^~~~
a.cc:33:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:32: error: 'endl' was not declared in this scope
   33 |                 cout << JOI << endl << IOI << endl;
      |                                ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<stack>
  +++ |+#include <ostream>
    4 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void){
	char a[10001];
	while(cin>>a;){
		
		
		int x=strlen(a);
		int cnt=0;
		int cnt1=0;
		
		for(int i=0;i<x;i++){
			if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I'){
				cnt++;
			}
			if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I'){
				cnt1++;
			}
		}
		cout<<cnt<<endl;
		cout<<cnt1<<endl;
	}
	return 0;
}
		


Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: expected ')' before ';' token
    5 |         while(cin>>a;){
      |              ~      ^
      |                     )
a.cc:5:22: error: expected primary-expression before ')' token
    5 |         while(cin>>a;){
      |                      ^
Language: C++

#include<iostream>
#include<string>
int main()
{
string ss;
cin >> ss;
int j=0,k=0;
for(int i=1;i<ss.length()-1;i++){
if(ss[i]=='O'){
if(ss[i+1]=='I'){
if(ss[i-1]=='J')j++;
if(ss[i-1]=='I')k++;
}
}
}
cout << j << "\n" << k << "\n";
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string ss;
      | ^~~~~~
a.cc:5:1: 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:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin >> ss;
      | ^~~
      | std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:8: error: 'ss' was not declared in this scope
    6 | cin >> ss;
      |        ^~
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout << j << "\n" << k << "\n";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main () {
    string s;
    int i, count;
while(cin >> s, s) {
    for(i=0;i<s.size();i++) {
        if(s[i]=='J')
            if(s[i+1]=='O')
                if(s[i+2]=='I') {
                    count++;
                    i += 1;
                }
           if(s[i]=='I')
            if(s[i+1]=='O')
                if(s[i+2]=='I') {
                    count++;
                    i += 1;
                }
    }      
}
cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: could not convert '(((void)std::operator>><char, char_traits<char>, allocator<char> >(std::cin, s)), s)' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
    8 | while(cin >> s, s) {
      |       ~~~~~~~~^~~
      |               |
      |               std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

int main () {
    string s;
    int i, joi, ioi;
while(cin >> s, !cin.eof()) {
    count = 0;
    for(i=0;i<s.size();i++) {
        if(s[i]=='J') {
            if(s[i+1]=='O') {
                if(s[i+2]=='I') {
                    joi++;
                    i += 1;
                }
            }
        }
           if(s[i]=='I') {
            if(s[i+1]=='O') {
                if(s[i+2]=='I') {
                    ioi++;
                    i += 1;
                }
            }
        }
    }      
}
cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'count' was not declared in this scope
    9 |     count = 0;
      |     ^~~~~
a.cc:29:9: error: 'count' was not declared in this scope
   29 | cout << count << endl;
      |         ^~~~~
Language: C++

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

int main () {
    string s;
    int i, joi, ioi;
while(cin >> s, !cin.eof()) {
    count = 0;
    for(i=0;i<s.size();i++) {
        if(s[i]=='J') {
            if(s[i+1]=='O') {
                if(s[i+2]=='I') {
                    joi++;
                    i += 1;
                }
            }
        }
           if(s[i]=='I') {
            if(s[i+1]=='O') {
                if(s[i+2]=='I') {
                    ioi++;
                    i += 1;
                }
            }
        }
    }      
}
cout << joi << endl << ioi << endl;
}

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

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

int main(void) {
	char buf[10000], comp[2][3] = {"JOI", "IOI"};
	int cou[2], i,c, t[2];
	
	while(scanf("%s", buf) != EOF){
		cou[0] = 0;
		cou[1] = 0;
		for(i = 0; strlen(buf)-2 > i; i++){
			t[0] = 0;
			t[1] = 0;
			for(c = 0; 3 > c; c++){
				if(comp[0][c] != buf[i + c]) t[0] = 1;
				if(comp[1][c] != buf[i + c]) t[1] = 1;
			}
			if(t[0] == 0)cou[0]++;
			if(t[1] == 0)cou[1]++;
		}
		printf("%d\n%d\n", cou[0],cou[1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:40: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 |         char buf[10000], comp[2][3] = {"JOI", "IOI"};
      |                                        ^~~~~
a.cc:5:47: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 |         char buf[10000], comp[2][3] = {"JOI", "IOI"};
      |                                               ^~~~~
Language: C++

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

int main(void) {
	char buf[10001], comp[2][3] = {"JOI", "IOI"};
	int cou[2], i,c, t[2];
	
	while(scanf("%s", buf) != EOF){
		cou[0] = 0;
		cou[1] = 0;
		for(i = 0; strlen(buf)-2 > i; i++){
			t[0] = 0;
			t[1] = 0;
			for(c = 0; 3 > c; c++){
				if(comp[0][c] != buf[i + c]) t[0] = 1;
				if(comp[1][c] != buf[i + c]) t[1] = 1;
			}
			if(t[0] == 0)cou[0]++;
			if(t[1] == 0)cou[1]++;
		}
		printf("%d\n%d\n", cou[0],cou[1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:40: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 |         char buf[10001], comp[2][3] = {"JOI", "IOI"};
      |                                        ^~~~~
a.cc:5:47: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 |         char buf[10001], comp[2][3] = {"JOI", "IOI"};
      |                                               ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int countKeyword(vector<int>* x, vector<int>* oi) {
	int count = 0;
	for (int i = 0; i < x->size(); i++) {
		std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1);
		if (iter != oi->end()) count++;
	}
	return count;
}

int main()
{
	char str[10000];
	vector<int> posI;
	vector<int> posJ;
	vector<int> posOI;

	cin >> str;

	for (int i = 0; str[i] != '\0'; i++) {
		if (str[i] == 'J') {
			posJ.push_back(i);
		} else if (str[i] == 'O' && str[i+1] == 'I') {
			posOI.push_back(i);
		} else if (str[i] == 'I') {
			posI.push_back(i);
		}
	}
	
	cout << countKeyword(&posJ, &posOI) << endl;
	cout << countKeyword(&posI, &posOI) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int countKeyword(std::vector<int>*, std::vector<int>*)':
a.cc:9:60: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)'
    9 |                 std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1);
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:9:60: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
    9 |                 std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1);
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
	while (cin){
		string n1;
		cin >> n1;
		int m1 = 0, m2 = 0;
                if(cin,eof())
		for (int i = 0; i < n1.size(); i++){
			if (n1[i] == 'J'){
				if (n1[i + 1] == 'O'){
					if (n1[i + 2] == 'I'){
						m1 += 1;
					}
				}
			}
			else if (n1[i] == 'I'){
				if (n1[i + 1] == 'O'){
					if (n1[i + 2] == 'I'){
						m2 += 1;
					}
				}
			}
		}
		cout << m1 << endl;
		cout << m2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'eof' was not declared in this scope; did you mean 'feof'?
   10 |                 if(cin,eof())
      |                        ^~~
      |                        feof
Language: C++

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

int main() {
	while (cin){
		string n1;
		cin >> n1;
		int m1 = 0, m2 = 0;
                if(cin,eof()) break;
		for (int i = 0; i < n1.size(); i++){
			if (n1[i] == 'J'){
				if (n1[i + 1] == 'O'){
					if (n1[i + 2] == 'I'){
						m1 += 1;
					}
				}
			}
			else if (n1[i] == 'I'){
				if (n1[i + 1] == 'O'){
					if (n1[i + 2] == 'I'){
						m2 += 1;
					}
				}
			}
		}
		cout << m1 << endl;
		cout << m2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'eof' was not declared in this scope; did you mean 'feof'?
   10 |                 if(cin,eof()) break;
      |                        ^~~
      |                        feof
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){

	string str,JOI="JOI",IOI="IOI";
	cin>>str
	int J=0,I=0,c1=0,c2=0,a=-1,b=-1;
	for(int i=0;i<str.size();i++){
		J=str.find(JOI,i);
		I=str.find(IOI,i);
		if(J>=0&&J!=a){
			c1++;
			a=J;
		}
		if(I>=0&&I!=b){
			c2++;
			b=I;
		}
	}
	cout<<c1<<endl<<c2<<endl;
	
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before 'int'
    7 |         cin>>str
      |                 ^
      |                 ;
    8 |         int J=0,I=0,c1=0,c2=0,a=-1,b=-1;
      |         ~~~      
a.cc:10:17: error: 'J' was not declared in this scope
   10 |                 J=str.find(JOI,i);
      |                 ^
a.cc:11:17: error: 'I' was not declared in this scope
   11 |                 I=str.find(IOI,i);
      |                 ^
a.cc:12:29: error: 'a' was not declared in this scope
   12 |                 if(J>=0&&J!=a){
      |                             ^
a.cc:13:25: error: 'c1' was not declared in this scope
   13 |                         c1++;
      |                         ^~
a.cc:16:29: error: 'b' was not declared in this scope
   16 |                 if(I>=0&&I!=b){
      |                             ^
a.cc:17:25: error: 'c2' was not declared in this scope
   17 |                         c2++;
      |                         ^~
a.cc:21:15: error: 'c1' was not declared in this scope
   21 |         cout<<c1<<endl<<c2<<endl;
      |               ^~
a.cc:21:25: error: 'c2' was not declared in this scope
   21 |         cout<<c1<<endl<<c2<<endl;
      |                         ^~
Language: C++

#include <stdio.h>

int main(void) {
	int i,joi,ioi;
	char s[11000];
	while (scanf("%s",s) != EOF){
		joi = 0;
		ioi = 0;
		for(i = 0;i <= 10998;i++){
			if(s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I'){
				joi++;
			}
			if(s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I'){
				ioi++;
			}
		}
		printf("%d\n%d\n",joi,ioi);
	}
	return 0;

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

#include <iostream>
#include <string>
using namespace std;
 
int main() {
	int IOI, JOI;
	string krsw[10000] = {};
	cin >> krsw[10000];
	for(int i = 0; i < 10000; i++){
		if(krsw[i] = 'I')
			if(krsw[i + 1] = 'O')
				if(krsw[i + 2] = 'I')
					IOI = IOI + 1;
		if(krsw[i] = 'J')
			if(krsw[i + 1] = 'O')
				if(krsw[i + 2] = 'I')
					JOI = JOI + 1;
	}
	cout << JOI << IOI <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: could not convert 'krsw[i].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool'
   10 |                 if(krsw[i] = 'I')
      |                    ~~~~~~~~^~~~~
      |                            |
      |                            std::__cxx11::basic_string<char>
a.cc:11:40: error: could not convert 'krsw[(i + 1)].std::__cxx11::basic_string<char>::operator=(79)' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |                         if(krsw[i + 1] = 'O')
      |                            ~~~~~~~~~~~~^~~~~
      |                                        |
      |                                        std::__cxx11::basic_string<char>
a.cc:12:48: error: could not convert 'krsw[(i + 2)].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |                                 if(krsw[i + 2] = 'I')
      |                                    ~~~~~~~~~~~~^~~~~
      |                                                |
      |                                                std::__cxx11::basic_string<char>
a.cc:14:28: error: could not convert 'krsw[i].std::__cxx11::basic_string<char>::operator=(74)' from 'std::__cxx11::basic_string<char>' to 'bool'
   14 |                 if(krsw[i] = 'J')
      |                    ~~~~~~~~^~~~~
      |                            |
      |                            std::__cxx11::basic_string<char>
a.cc:15:40: error: could not convert 'krsw[(i + 1)].std::__cxx11::basic_string<char>::operator=(79)' from 'std::__cxx11::basic_string<char>' to 'bool'
   15 |                         if(krsw[i + 1] = 'O')
      |                            ~~~~~~~~~~~~^~~~~
      |                                        |
      |                                        std::__cxx11::basic_string<char>
a.cc:16:48: error: could not convert 'krsw[(i + 2)].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool'
   16 |                                 if(krsw[i + 2] = 'I')
      |                                    ~~~~~~~~~~~~^~~~~
      |                                                |
      |                                                std::__cxx11::basic_string<char>
Language: C++

#include <cstdio>
#include <iostream>
#include <functional>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

#define println(s) cout << s << '\n';
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


char str[10001];

int main() {
  while(cin >> str) {
    int count_joi = 0;
    int count_ioi = 0;
    for (int i=0; i<strlen(str)-2; i++) {
      if (str[i+0] == 'J' && str[i+1] == 'O' && str[i+2] == 'I') count_joi++;
      if (str[i+0] == 'I' && str[i+1] == 'O' && str[i+2] == 'I') count_ioi++;
    }
    println(count_joi);
    println(count_ioi);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: 'strlen' was not declared in this scope
   24 |     for (int i=0; i<strlen(str)-2; i++) {
      |                     ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <cmath>
  +++ |+#include <cstring>
   10 |
Language: C++

#define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	char s[12000];
	
	while(scanf("%s",s)!=EOF){
		int len = strlen(s);
		int n=0,m=0;
		for(int i=0;i<len-2;i++){
			if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I')
				n++;
			else if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I')
				m++;
		}
		cout<<n<<endl;
		cout<<m<<endl;
		}
	



}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: 'strlen' was not declared in this scope
   20 |                 int len = strlen(s);
      |                           ^~~~~~
a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <list>
  +++ |+#include <cstring>
   14 | using namespace std;
Language: C++

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

using namespace std;

int main()
{
    int cnt[2] = {0};
    string target[] = {"JOI", "IOI"};
    string a;
    cin >> a;
        for(int i = 0;i < 2;i++){
            for (int j = 0; j < a.size(); j++) {
                b = a.find(target[i], j);
                if(b != string::npos){
                    cnt[i]++;
                    i = i + b;
                }
            }

        }

    cout << cnt << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'b' was not declared in this scope
   17 |                 b = a.find(target[i], j);
      |                 ^
Language: C++

#include<cstdio>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int count1, count2,i;

int main(){
    char str[10001];
    while(1){
    count1=0;
    count2=0;
    i=0;
    for(int i=0;i<1000a;i++){
        scanf("%s",&str[i]);
        if(EOF)break;
    }
	for (int i = 0; i < 10000; i++)
	{
		if (str[i] == 'J'&&str[i+1]=='O'&&str[i+2]=='I'){
                        count1++;
                }
		if (str[i] == 'I'&&str[i + 1] == 'O'&&str[i + 2] == 'I'){
					count2++;
                }
    }
	cout << count1 << endl;
	cout << count2 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: unable to find numeric literal operator 'operator""a'
   15 |     for(int i=0;i<1000a;i++){
      |                   ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <set>

using namespace std;

int main()
{
	char ch[1000000];
	cin >> ch;
	int count = 0, bcount = 0;
	for (int i = 0; i < strlen(ch); i++)
	{
		if (ch[i] == 'J'&&ch[i + 1] == 'O'&&ch[i + 2] == 'I')
		{
			count++;
		}
		if (ch[i] == 'I'&&ch[i + 1] == 'O'&&ch[i + 2] == 'I')
		{
			bcount++;
		}
	}
	cout << count << endl << bcount << endl;

	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: 'strlen' was not declared in this scope
   15 |         for (int i = 0; i < strlen(ch); i++)
      |                             ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <set>
  +++ |+#include <cstring>
    7 |
Language: C++

#include<iostream>
using namespace std;
int main(){
char text[10000],joi,ioi;
while(1){
cin>>text;
if(text[0]== "EOF") break;
for(int i=0;i<9998;i++){
if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++;
if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;ioi=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 | if(text[0]== "EOF") break;
      |    ~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
char text[10000];
int joi,ioi;
while(1){
cin>>text;
if(text[0]== "EOF") break;
for(int i=0;i<9998;i++){
if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++;
if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;ioi=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if(text[0]== "EOF") break;
      |    ~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
char text[10000];
int joi,ioi;
while(cin>>text){
for(int i=0;i<9998;i++){
if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++;
if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;ioi=0;
text="";
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: incompatible types in assignment of 'const char [1]' to 'char [10000]'
   13 | text="";
      | ~~~~^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
char text[];
int joi,ioi;
while(cin>>text){
for(int i=0;i<9998;i++){
if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++;
if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;ioi=0;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:6: error: storage size of 'text' isn't known
    4 | char text[];
      |      ^~~~
Language: C++

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

int main(){
	char str[1001];
	char JOI[4] = "JOI";
	char IOI[4] = "IOI";
	
	int length = strlen(str);
	bool joiSame = true;
	bool ioiSame = true;
	int joiSameCount = 0;
	int ioiSameCount = 0;
	while(true){
	cin >> str;
	if(str == null){
		break;
	}
	for(int i=0;i<length-2;i++){
	joiSame = true;
	ioiSame = true;
		for(int j=0;j<3;j++){
			if(str[i+j] != JOI[j]){
				joiSame = false;
			}
			if(str[i+j] != IOI[j]){
				ioiSame = false;
			}
			if(!joiSame && !ioiSame){
				break;
			}
		}
		if(joiSame){
			joiSameCount++;
		}else if(ioiSame){
			ioiSameCount++;
		}
	}
	cout << joiSameCount << '\n' << ioiSameCount << '\n';
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'null' was not declared in this scope
   17 |         if(str == null){
      |                   ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){

   char str[10001];

   int joi=0,ioi=0;

   bool check::eof()

   while(!check){

   cin >> str;

   for(int i=0;str[i+2] != '\0'; i++){

       if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++;

       else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++;
   }

  cout << joi <<endl << ioi <<endl;

 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'check' has not been declared
   10 |    bool check::eof()
      |         ^~~~~
a.cc:10:19: error: qualified-id in declaration before '(' token
   10 |    bool check::eof()
      |                   ^
Language: C++

#include<iostream>
using namespace std;

int main(){

   char str[10001];

   int joi=0,ioi=0;

   bool check::eof();

   while(!check){

   cin >> str;

   for(int i=0;str[i+2] != '\0'; i++){

       if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++;

       else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++;
   }

  cout << joi <<endl << ioi <<endl;

 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'check' has not been declared
   10 |    bool check::eof();
      |         ^~~~~
a.cc:10:19: error: qualified-id in declaration before '(' token
   10 |    bool check::eof();
      |                   ^
a.cc:12:11: error: 'check' was not declared in this scope
   12 |    while(!check){
      |           ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){

   char str[10001];

   int joi=0,ioi=0;

   cin >> str;

   while(!str.eof()){
  
   joi=0;ioi=0;
 
   for(int i=0;str[i+2] != '\0'; i++){

       if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++;

       else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++;
   }

  cout << joi <<endl << ioi <<endl;

  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: request for member 'eof' in 'str', which is of non-class type 'char [10001]'
   12 |    while(!str.eof()){
      |               ^~~
Language: C++

//AOJ0522

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

int main(){

  while(1){
    string str;
    cin>>str;

    int cntJOI,cntIOI;
    cntJOI=0,cntIOI=0;

    for(int i=0;i<str.size()-2;i++){
      if(str[i+1]=='O'&&str[i+2]=='I'){
        if(str[i]=='J'){
          cntJOI++;
        }
        else if(str[i]=='I'){
          cntIOI++;
        }
      }
    }
  }

  cout<<cntJOI<<"\n"<<cntIOI<<"\n";

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'cntJOI' was not declared in this scope
   28 |   cout<<cntJOI<<"\n"<<cntIOI<<"\n";
      |         ^~~~~~
a.cc:28:23: error: 'cntIOI' was not declared in this scope
   28 |   cout<<cntJOI<<"\n"<<cntIOI<<"\n";
      |                       ^~~~~~
Language: C++

#include <cstdio>
#include <cstring>
using namespace std;
char s[10002];
int J,I;
int main()
{
while(1){ scanf("%s",s);
 if(s==EOF) return 0;
 J=0; I=0;
 for(int i=0;i<strlen(s)-2;i++){
 if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') J++;
 if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') I++;
}
 printf("%d\n%d\n",J,I);
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if(s==EOF) return 0;
      |      ^
Language: C++

#include <cstdio>
#include <cstring>
using namespace std;
char s[10002];
int J,I;
int main()
{
while(1){ scanf("%s",s);
 if(s[0]==\0) return 0;
 J=0; I=0;
 for(int i=0;i<strlen(s)-2;i++){
 if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') J++;
 if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') I++;
}
 printf("%d\n%d\n",J,I);
}}

Compiler output:
a.cc:9:11: error: stray '\' in program
    9 |  if(s[0]==\0) return 0;
      |           ^
Language: C++

#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{	
	char test1;
	while(cin>>test1){
		int num1=0,num2=0,num3=0;
		num1=strlen(test1);
		for(int i=0;i<num1-2;i++){
			if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){
				num2=num2+1;
			}
			if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){
				num3=num3+1;
			}
		}
		cout<<num2;
		cout<<"\n";
		cout<<num3;
		cout<<"\n";
		num2=0;
		num3=0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   10 |                 num1=strlen(test1);
      |                             ^~~~~
      |                             |
      |                             char
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:3:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:12:33: error: invalid types 'char[int]' for array subscript
   12 |                         if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                 ^
a.cc:12:48: error: invalid types 'char[int]' for array subscript
   12 |                         if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                                ^
a.cc:12:65: error: invalid types 'char[int]' for array subscript
   12 |                         if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                                                 ^
a.cc:15:33: error: invalid types 'char[int]' for array subscript
   15 |                         if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                 ^
a.cc:15:48: error: invalid types 'char[int]' for array subscript
   15 |                         if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                                ^
a.cc:15:65: error: invalid types 'char[int]' for array subscript
   15 |                         if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){
      |                                                                 ^
Language: C++

#include <iostream>
using namespace std;
int main(){
    int moji,count1=0,count2=0;
    char str[10000];
    cin>>str;
    moji=strlen(str);
    for(int j=0;j<moji;j++){
        if(str[j]=='J' && str[j+1]=='O' && str[j+2]=='I'){
            count1+=1;
        }
        if(str[j]=='I' && str[j+1]=='O' && str[j+2]=='I'){
            count2+=1;
        }
    }
    cout<<count1<<endl<<count2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'strlen' was not declared in this scope
    7 |     moji=strlen(str);
      |          ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;