submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s048576520 | p00445 | 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+... | 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
|
s881191401 | p00445 | 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;
} | 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
|
s106338726 | p00445 | 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;
}... | 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'};
| ... |
s136376227 | p00445 | 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){
... | 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'};
| ... |
s340410544 | p00445 | 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){
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s142077769 | p00445 | 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++;
}
p... | 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 de... |
s788152244 | p00445 | 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... | 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;... |
s501790223 | p00445 | 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[... | 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 <stri... |
s204266709 | p00445 | 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++;
}
}
}
i... | 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 <stri... |
s770293844 | p00445 | 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;
c... | 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;){
| ^
|
s327230565 | p00445 | 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;
} | 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,
... |
s280516072 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main () {
string s;
int i;
while(cin >> s, s!=EOF) {
for(i=0;i<s.size();i++) {
if(s[i]=='J')
if(s[i+1]=='O')
if(s[i+2]=='I') {
count++;
i += 1;
}
... | a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | while(cin >> s, s!=EOF) {
| ~^~
| |
| std::string {aka std::__cxx11::basic_string<cha... |
s038110566 | p00445 | 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;
}
... | 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) {
| ~~~~~~~~^~~
| |
| ... |
s673158089 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main () {
string s;
int i, count;
while(cin >> s, s!=false) {
for(i=0;i<s.size();i++) {
if(s[i]=='J')
if(s[i+1]=='O')
if(s[i+2]=='I') {
count++;
i += 1;
... | a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'bool')
8 | while(cin >> s, s!=false) {
| ~^~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c... |
s464987854 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main () {
string s;
int i, count;
while(cin >> s, s!=-1) {
for(i=0;i<s.size();i++) {
if(s[i]=='J')
if(s[i+1]=='O')
if(s[i+2]=='I') {
count++;
i += 1;
}
... | a.cc: In function 'int main()':
a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | while(cin >> s, s!=-1) {
| ~^~~~
| | |
| | int
| std::string ... |
s877850114 | p00445 | 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... | 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;
| ^~~~~
|
s961395019 | p00445 | 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... | a.cc: In function 'int main()':
a.cc:9:5: error: 'count' was not declared in this scope
9 | count = 0;
| ^~~~~
|
s242434649 | p00445 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
//#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef ... | a.cc: In function 'void func()':
a.cc:21:38: error: expected ';' before '<' token
21 | #define FOR(i,a,b) for(int i = (a),i < (b); i++)
| ^
a.cc:455:9: note: in expansion of macro 'FOR'
455 | FOR(i,2,l)
| ^~~
a.cc:21:38: error: expected primary-expre... |
s239768855 | p00445 | 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] ... | 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 | ... |
s026338385 | p00445 | 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] ... | 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 | ... |
s073240468 | p00445 | 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()
... | 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::fi... |
s590317389 | p00445 | 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;
}
}
}
els... | 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
|
s576765036 | p00445 | 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;
}
}
}... | 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
|
s227078393 | p00445 | 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<... | 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... |
s731456205 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string str,JOI="JOI",IOI="IOI";
while(true){
cin>>str;
if(str==EOF)return 0;
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){
... | a.cc: In function 'int main()':
a.cc:9:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
9 | if(str==EOF)return 0;
| ~~~^~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In fi... |
s463564188 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string str,JOI="JOI",IOI="IOI";
while(true){
cin>>str;
if(str==-1)return 0;
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){
... | a.cc: In function 'int main()':
a.cc:9:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
9 | if(str==-1)return 0;
| ~~~^~~~
| | |
| | int
| std::string {aka std::... |
s259059352 | p00445 | C++ | #include <iostream>
#include <string>
#include<cstdio>
using namespace std;
int main(){
string str,JOI="JOI",IOI="IOI";
while(true){
cin>>str;
if(str==EOF)return 0;
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;
}
i... | a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
10 | if(str==EOF)return 0;
| ~~~^~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In f... |
s422998937 | p00445 | C++ | include <iostream>
#include <string>
using namespace std;
int main(){
string s;
while( cin >> s){
string joi = "JOI",ioi = "IOI";
int num_joi=0,num_ioi=0;
for(int i=0;i < s.size()-2 ;i++) {
string sub= s.substr(i,3) ;
if(sub == joi) num_joi++;
if(sub == ioi) num_ioi++;
}
cout << num_joi ... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a typ... |
s361847027 | p00445 | 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\... | 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) {
| ^
|
s517345431 | p00445 | 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 +... | 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')
| ~~~~~~~~^~~~~
| |
| ... |
s462294567 | p00445 | C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>
using namespace std;
int main() {
int joi=0,ioi=0;
string str;
cin >> str;
for(int i=0;i<str.size()-2;i++){
if(str[i+1]=='O'&&str[i+2]=='I'){
if(str[i]=='J')
joi++;
if(str[i]=='I... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 1
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a... |
s760914898 | p00445 | 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... | 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>
+... |
s738808956 | p00445 | 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)!=EO... | 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>
+... |
s482906444 | p00445 | 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)!=EO... | 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>
+... |
s891633676 | p00445 | 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.fi... | 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);
| ^
|
s057841481 | p00445 | 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;... | 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++){
| ^~~~~
|
s677189915 | p00445 | 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++;
}
... | 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 <... |
s891037850 | p00445 | 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... | 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;
| ~~~~~~~^~~~~~~~
|
s122196667 | p00445 | 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;
}
ret... | 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;
| ~~~~~~~^~~~~~~~
|
s935848986 | p00445 | 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;
} | a.cc: In function 'int main()':
a.cc:13:5: error: incompatible types in assignment of 'const char [1]' to 'char [10000]'
13 | text="";
| ~~~~^~~
|
s552092460 | p00445 | 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;
} | a.cc: In function 'int main()':
a.cc:13:5: error: incompatible types in assignment of 'const char [1]' to 'char [10000]'
13 | text="";
| ~~~~^~~
|
s577820363 | p00445 | 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;
} | a.cc: In function 'int main()':
a.cc:4:6: error: storage size of 'text' isn't known
4 | char text[];
| ^~~~
|
s854017110 | p00445 | 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;
} | a.cc: In function 'int main()':
a.cc:4:6: error: storage size of 'text' isn't known
4 | char text[];
| ^~~~
|
s390009130 | p00445 | C++ | #include <iostream>
#include <cstring>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
int main() {
char str[10001];
while (cin >> str != NULL) {
int joi = 0, ioi = 0;
REP(i,strlen(str) - 2) {
if (strncmp(&str[i], "IOI", 3) == 0) ioi++;
else if (strncmp(&str[i], "JOI", 3) == 0) joi++;
}
... | a.cc: In function 'int main()':
a.cc:11:27: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'long int')
11 | while (cin >> str != NULL) {
| ^
a.cc:11:27: note: candidate: 'operator!=(int, long int)' (built-in)
a.cc:11:27: note: no known con... |
s932881056 | p00445 | 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... | a.cc: In function 'int main()':
a.cc:17:19: error: 'null' was not declared in this scope
17 | if(str == null){
| ^~~~
|
s212381331 | p00445 | 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] ==... | 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()
| ^
|
s305922305 | p00445 | 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] =... | 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 | ... |
s128246817 | p00445 | 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] ... | 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()){
| ^~~
|
s309405247 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string str;
int joi=0,ioi=0,i=0;
while(cin >> str){
if(str == 0) break;
while(i < str.size()){
if(str.find(JOI,i)){
i = str.find(JOI,i);
joi++;
}
i = 0;
while(i < str.size()){
if(str.find(IOI,... | a.cc: In function 'int main()':
a.cc:13:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
13 | if(str == 0) break;
| ~~~ ^~ ~
| | |
| | int
| std::string {aka std::__cxx11::basic_... |
s120800061 | p00445 | 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(... | 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";
| ^~~~~~
|
s849563934 | p00445 | 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);
}} | 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;
| ^
|
s330079254 | p00445 | 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);
}} | a.cc:9:11: error: stray '\' in program
9 | if(s[0]==\0) return 0;
| ^
|
s595096617 | p00445 | 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'&&tes... | 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... |
s161129226 | p00445 | 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')... | 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 ... |
s711390664 | p00445 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
char str[12345];
int main(){
int joi_ans;
int ioi_ans;
while (1){
memset(str, 0, sizeof(str));
if (scanf("%s", str) == EOF) return 0;
joi_ans = 0;
ioi_ans = 0;
for (int a = 0;; a++){
if (str[a] == 'J' &&
str[a + 1] == 'O' &&
str[a + 2]... | a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
11 | memset(str, 0, sizeof(str));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
... |
s268070621 | p00445 | C++ | #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
while(cin >> s) {
int jcnt = 0,icnt = 0;
Rep(i,s.size() - 2) {
if(s[i + 2] == 'I' && s[i + 1] == 'O') {
if(s[i] == 'J') {
jcnt++;
}else if(s[i] == 'I') {
icnt++;
}
}
}
cout << jcnt... | a.cc: In function 'int main()':
a.cc:6:16: error: 's' was not declared in this scope
6 | while(cin >> s) {
| ^
|
s784543999 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int solve(string s){
int joi=0,ioi=0;
for(int i=0;i<s.size()-2;i++){
if(s.substr(i,3)=="JOI")joi++;
else if(s.substr(i,3)=="IOI")ioi++;
}
cout<<joi<<endl;
cout<<ioi<<endl;
return 0;
}
int main(){
string s;
whlie(cin>>s){
solve(s);
... | a.cc: In function 'int main()':
a.cc:18:3: error: 'whlie' was not declared in this scope
18 | whlie(cin>>s){
| ^~~~~
|
s108836564 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
#include<string.h>
int main(){
string a;
cin>>a;
while(cin >> s, !cin.eof()) {
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
}
}
cout<<joi << endl;
cout... | a.cc: In function 'int main()':
a.cc:8:22: error: 's' was not declared in this scope
8 | while(cin >> s, !cin.eof()) {
| ^
a.cc:17:15: error: 'joi' was not declared in this scope
17 | cout<<joi << endl;
| ^~~
a.cc:18:15: error: 'ioi' was not declared... |
s343283062 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
#include<string.h>
int main(){
string a;
cin>>a;
while(cin >> s, !cin.eof()) {
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
}
cout<<joi << endl;
cout<<i... | a.cc: In function 'int main()':
a.cc:8:22: error: 's' was not declared in this scope
8 | while(cin >> s, !cin.eof()) {
| ^
|
s432561642 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
#include<string.h>
int main(){
string a;
cin>>a;
while(cin >> s,){
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
}
cout<<joi << endl;
cout<<ioi << endl;
... | a.cc: In function 'int main()':
a.cc:8:22: error: 's' was not declared in this scope
8 | while(cin >> s,){
| ^
a.cc:8:24: error: expected primary-expression before ')' token
8 | while(cin >> s,){
| ^
|
s055600334 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a;
cin>>a;
while(cin >> s,){
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
}
cout<<joi << endl;
cout<<ioi << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:22: error: 's' was not declared in this scope
7 | while(cin >> s,){
| ^
a.cc:7:24: error: expected primary-expression before ')' token
7 | while(cin >> s,){
| ^
|
s543584838 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a;
cin>>a;
while(cin >> a){
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
}
cout<<joi << endl;
cout<<ioi << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:19: error: 's' was not declared in this scope
9 | for(i=0;i<s.size()-2;i++){
| ^
|
s019183800 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a;
cin>>a;
while(cin >> a,!cin.eof()){
int i,ioi=0,joi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
i+=1;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
i+=1;
}
cout<<joi << endl;
cout<<ioi <<... | a.cc: In function 'int main()':
a.cc:9:19: error: 's' was not declared in this scope
9 | for(i=0;i<s.size()-2;i++){
| ^
|
s835112167 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a;
int i,ioi=0,joi=0;
while(cin >> a,!cin.eof()){
joi=0;
ioi=0;
for(i=0;i<s.size()-2;i++){
if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I')
joi++;
i+=1;
if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I')
ioi++;
i+=1;
}
cout<<joi << endl;
cout<... | a.cc: In function 'int main()':
a.cc:10:19: error: 's' was not declared in this scope
10 | for(i=0;i<s.size()-2;i++){
| ^
|
s213341310 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string a;
int i,ioi,joi;
while(cin >> s, !cin.eof()) {
????????joi = 0;
????????ioi = 0;
????????for(i=0;i<s.size()-2;i++) {
????????????????if(a[i]=='J') {
????????????????????????if(a[i+1]=='O') {
????????????????????????????????if(a[i+2]=='I') {
... | a.cc: In function 'int main()':
a.cc:7:14: error: 's' was not declared in this scope
7 | while(cin >> s, !cin.eof()) {
| ^
a.cc:8:1: error: expected primary-expression before '?' token
8 | ????????joi = 0;
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ???????... |
s845958233 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
int main () {
string a;
int i, joi, ioi;
while(cin >> s, !cin.eof()) {
joi = 0;
ioi = 0;
for(i=0;i<a.size()-2;i++) {
if(a[i]=='J') {
if(a[i+1]=='O') {
if(a[i+2]=='I') {
joi++;
... | a.cc: In function 'int main()':
a.cc:7:14: error: 's' was not declared in this scope
7 | while(cin >> s, !cin.eof()) {
| ^
|
s921513242 | p00445 | C++ | #include <iostream>
#include <string>
using namespace std;
??
int main () {
????????string s;
????????int i, joi, ioi;
while(cin >> s, !cin.eof()) {
????????joi = 0;
????????ioi = 0;
????????for(i=0;i<s.size()-2;i++) {
????????????????if(s[i]=='J') {
????????????????????????if(s[i+1]=='O') {
???????????????????????????... | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
|
s748634115 | p00445 | C++ | #include<iostream>
#include<string.h>
using namespace std;
int main(){
char a[10000];
int i,ioi,joi;
while(cin>>a,!cin.eof())[
joi=0;
ioi=0;
for(i=0;i<strlen(a);i++){
if(a[i]=='J',a[i+1]=='O',a[i+2]=='I')
joi++;
if(a[i]=='I',a[i+1]=='O',a[i+2]=='I')
ioi++;
}
cout << joi << endl;
cout << ioi <... | a.cc: In function 'int main()':
a.cc:8:22: error: expected ',' before ';' token
8 | joi=0;
| ^
| ,
a.cc:8:22: error: expected identifier before ';' token
a.cc:8:22: error: expected ']' before ';' token
8 | joi=0;
| ... |
s967356696 | p00445 | C++ | #include<iostream>
#include<string.h>
using namespace std;
int main(){
char a[10001];
int i,ioi,joi;
while(cin>>a,!cin.eof())[
joi=0;
ioi=0;
for(i=0;i<strlen(a);i++){
if(a[i]=='J',a[i+1]=='O',a[i+2]=='I')
joi++;
else if(a[i]=='I',a[i+1]=='O',a[i+2]=='I')
ioi++;
}
cout << joi << endl;
cout << ... | a.cc: In function 'int main()':
a.cc:8:22: error: expected ',' before ';' token
8 | joi=0;
| ^
| ,
a.cc:8:22: error: expected identifier before ';' token
a.cc:8:22: error: expected ']' before ';' token
8 | joi=0;
| ... |
s049322230 | p00445 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
????????char str[10000] = { 0 }, str2[10000];
????????int i, m, n, j, joi, ioi;
????????while (scanf("%s", str) != EOF){
????????????????joi = 0;
????????????????ioi = 0;
????????????????n = strlen(str);
????????????????for (i = 0; i < n; i++) {
????????????????????????... | a.cc: In function 'int main()':
a.cc:5:1: error: expected primary-expression before '?' token
5 | ????????char str[10000] = { 0 }, str2[10000];
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ????????char str[10000] = { 0 }, str2[10000];
| ^
a.cc:5:3: error: expected primary-e... |
s096722972 | p00445 | C++ | #include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int JOI=0,IOI=0;
int i;
cin>>a;
int s=a.size();
if(a.substr(i,3)=="JOI");{
JOI++;
}
if(b.substr(i,3)=="IOI");{
IOI++;
}
cout<<JOI<<endl;
cout<<IOI<<endl;
} | a.cc: In function 'int main()':
a.cc:9:10: error: 'a' was not declared in this scope
9 | cin>>a;
| ^
a.cc:14:9: error: 'b' was not declared in this scope
14 | if(b.substr(i,3)=="IOI");{
| ^
|
s202557837 | p00445 | C++ | #include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int JOI=0,IOI=0;
int i;
cin>>a;
int s=a.size();
if(a.substr(i,3)=="JOI");{
JOI++;
}
if(b.substr(i,3)=="IOI");{
IOI++;
}
cout<<JOI<<endl;
cout<<IOI<<endl;
} | a.cc: In function 'int main()':
a.cc:9:10: error: 'a' was not declared in this scope
9 | cin>>a;
| ^
a.cc:14:9: error: 'b' was not declared in this scope
14 | if(b.substr(i,3)=="IOI");{
| ^
|
s119026758 | p00445 | C++ | #include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string a[100001];
int JOI=0,IOI=0;
int i;
cin>>a;
int s=a.size();
if(a.substr(i,3)=="JOI");{
JOI++;
}
if(a.substr(i,3)=="IOI");{
IOI++;
}
cout<<JOI<<endl;
cout<<IOI<<end... | a.cc: In function 'int main()':
a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'})
9 | cin>>a;
| ~~~^~~
| | |
| | std::string [100001] {aka... |
s604697859 | p00445 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
int main() {
string s... | a.cc: In function 'int main()':
a.cc:24:28: error: 'joi' was not declared in this scope
24 | printf("%d\n%d\n", joi, ioi);
| ^~~
a.cc:24:33: error: 'ioi' was not declared in this scope
24 | printf("%d\n%d\n", joi, ioi);
| ^~~
|
s588146589 | p00445 | C++ | #include <iostream>
using namespace std;
int main(){
int joi=0,ioi=0,i=0;
string s;
while(1){
cin >> s;
if(s == EOF)
break;
for(i=0;i<s.size()-3;i++){
if(s[i] == 'J'){
if(s[i+1] == 'O' && s[i+2] == 'I'){
joi++;
}
}
if(s[i] == 'I'){
if(s[i+1] == 'O' && s[i+2] == 'I'){
... | a.cc: In function 'int main()':
a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
9 | if(s == EOF)
| ~ ^~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/incl... |
s054469325 | p00445 | C++ | #include <iostream>
using namespace std;
int main(){
int joi=0,ioi=0,i=0;
string s;
cin >> s;
for(i=0;i<s.size()-2;i++){
if(s.substr(i,3) == "JOI"){
joi++;
i++
}
if(s.subst(i,3) == "IOI"){
ioi++;
i++;
}
}
cout << joi << endl << ioi << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before '}' token
12 | i++
| ^
| ;
13 | }
| ~
a.cc:14:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subst'; did you mean 'substr'... |
s824336566 | p00445 | C++ | #include <iostream>
using namespace std;
int main(){
int joi=0,ioi=0,i=0;
string s;
cin >> s;
for(i=0;i<s.size()-2;i++){
if(s.substr(i,3) == "JOI"){
joi++;
i++
}
if(s.substr(i,3) == "IOI"){
ioi++;
i++;
}
}
cout << joi << endl << ioi << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before '}' token
12 | i++
| ^
| ;
13 | }
| ~
|
s653390653 | p00445 | C++ | #include <list>
#include <vector>
#include <deque>
#include <numeric>
using namespace std;
int main() {
char str[10000];
int joi = 0, ioi = 0;
for (int i = 0; i < 5; i++) {
if (gets_s(str) == NULL) break;
for (int j = 0; j < strlen(str)-2; j++) {
if (str[j] == 'J'&&str[j + 1] == 'O' && str[j + 2] == 'I'... | a.cc: In function 'int main()':
a.cc:11:21: error: 'gets_s' was not declared in this scope
11 | if (gets_s(str) == NULL) break;
| ^~~~~~
a.cc:12:37: error: 'strlen' was not declared in this scope
12 | for (int j = 0; j < strlen(str)-2; j++) {
| ... |
s316049255 | p00445 | C++ | #include <iostream>
#include <string>
#include <list>
#include <vector>
#include <deque>
#include <numeric>
using namespace std;
int main() {
char str[10000];
int joi = 0, ioi = 0;
for (int i = 0; i < 5; i++) {
if (gets_s(str) == NULL) break;
for (int j = 0; j < strlen(str)-2; j++) {
if (str[j] == 'J'&&... | a.cc: In function 'int main()':
a.cc:13:21: error: 'gets_s' was not declared in this scope
13 | if (gets_s(str) == NULL) break;
| ^~~~~~
a.cc:14:37: error: 'strlen' was not declared in this scope
14 | for (int j = 0; j < strlen(str)-2; j++) {
| ... |
s394948716 | p00445 | C++ | #include <iostream>
#include <string>
#include <string.h>
#include <list>
#include <vector>
#include <deque>
#include <numeric>
using namespace std;
int main() {
char str[10000];
int joi = 0, ioi = 0;
for (int i = 0; i < 5; i++) {
if (gets(str) == NULL) break;
for (int j = 0; j < strlen(str)-2; j++) {
i... | a.cc: In function 'int main()':
a.cc:14:21: error: 'gets' was not declared in this scope; did you mean 'getw'?
14 | if (gets(str) == NULL) break;
| ^~~~
| getw
|
s575486538 | p00445 | C++ | #include<string>
using namespace std;
int main(void)
{
string set;
int joi=0;
int ioi=0;
for (int a=0;a<3;a++)
{
cin>>set;
lnog long b=set.size();
for (int c=0;c<b-2;c++)
{
if (set.substr(c,3)=="JOI") joi++;
if (set.substr(c,3)=="IOI") ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;
ioi=0;
}
r... | a.cc: In function 'int main()':
a.cc:10:17: error: 'cin' was not declared in this scope
10 | cin>>set;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream... |
s900074465 | p00445 | C++ | using namespace std;
int main(void)
{
string set;
int joi=0;
int ioi=0;
for (int a=0;a<5;a++)
{
cin>>set;
long b=set.size();
for (int c=0;c<b-2;c++)
{
if (set.substr(c,3)=="JOI") joi++;
if (set.substr(c,3)=="IOI") ioi++;
}
cout<<joi<<endl<<ioi<<endl;
joi=0;
ioi=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
4 | string set;
| ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
+++ |+#include <string>
1 | using namespace std;
a.cc:9:... |
s636895071 | p00445 | C++ | #include <iostream>
#include<string.h>
using namespace std;
int main() {
int len,coj=0,coi=0;
char mozi[10005]={};
while(cin>>mozi){
len=0;
coj=0;
coi=0;
len=strlen(mozi);
for(int i=0;i<len;i++){
if(mozi[i]=="J"){
if(mozi[i+1]=="O"){
if(mozi[i+2]=="I"){
coj++;
}
}
}
if(mo... | a.cc: In function 'int main()':
a.cc:14:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(mozi[i]=="J"){
| ~~~~~~~^~~~~
a.cc:15:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | ... |
s412979535 | p00445 | C++ | TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZYIJOIKGVUYWWJOIMZNRIAKRHUKVOWXUAJOIUGJOIBSUUJOIMJJQJOIOKDUDMPIDXJWJJOIGJOIDJOIRKDJOIEPYFNKTXTAFWIJOIAQWTAAQDSQVNGYETRMTDLFIJCKYOIFJNKADVWFCMFQREMSVEPGNZAPUIFTPCVAARIBPXEWOJOIZZEKLZOPIFHD
WLLFIIOITIOIJUOQUIGUKOIOIRFQKXRVLIOIMQBYMJTIOIKZNDIOICRYIOILTIOIZIOIAJUQNJGDPYZURIOINSJPKFC... | a.cc:1:1: error: 'TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZYIJOIKGVUYWWJOIMZNRIAKRHUKVOWXUAJOIUGJOIBSUUJOIMJJQJOIOKDUDMPIDXJWJJOIGJOIDJOIRKDJOIEPYFNKTXTAFWIJOIAQWTAAQDSQVNGYETRMTDLFIJCKYOIFJNKADVWFCMFQREMSVEPGNZAPUIFTPCVAARIBPXEWOJOIZZEKLZOPIFHD' does not name a type
1 | TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZY... |
s058417964 | p00445 | C++ | #include<iostream>
using namespace std;
int main()
{
for(;;){
char str[1000];
int joi = 0, ioi = 0;
if(scanf("%s",str) == EOF){
break;
}
//JOIツ板サツ津ィ
for(int i = 0; i < (unsigned)strlen(str); i++){
if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){
joi++;
}
}
for(int i = 0; i ... | a.cc: In function 'int main()':
a.cc:16:46: error: 'strlen' was not declared in this scope
16 | for(int i = 0; i < (unsigned)strlen(str); i++){
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#i... |
s110681219 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
for(;;){
char str[1000];
int joi = 0, ioi = 0;
if(scanf("%s",str) == EOF){
break;
}
//JOIツ板サツ津ィ
for(int i = 0; i < (unsigned)strlen(str); i++){
if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){
joi++;
}
}
... | a.cc: In function 'int main()':
a.cc:17:46: error: 'strlen' was not declared in this scope
17 | for(int i = 0; i < (unsigned)strlen(str); i++){
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#i... |
s521001275 | p00445 | C++ | #include<stdio.h>
int main(){
int i,j,k;
char s[10002];
scanf("%s",s)ツ;
i=0;j=0;
for(k=0;s[k]!='\n';k++){
if(s[k+1]=='O' && s[k+2]=='I'){
if(s[k]=='J')j++;
if(s[k]=='I')i++;
}
}
printf("%d\n%d\n",j,i);
} | a.cc: In function 'int main()':
a.cc:6:22: error: expected ';' before '\U000030c4\U0000ff1b'
6 | scanf("%s",s)ツ;
| ^~~~
| ;
|
s893222337 | p00445 | C++ | include<stdio.h>
#include<string.h>
int main(void){
int i, j;
int joi, ioi;
int len;
char str[100000], jd[256];
memset(str,'\0',sizeof(str));
memset(jd,'\0',sizeof(jd));
while (scanf("%s", str) != EOF){
len = strlen(str);
joi = ioi = 0;
for (i = 0;i < len - 2;i++){
if (str[i] == 'J' && str[... | a.cc:1:1: error: 'include' does not name a type
1 | include<stdio.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'memset' was not declared in this scope
10 | memset(str,'\0',sizeof(str));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable ... |
s592926913 | p00445 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int i=0,joi=0,ioi=0;
char string[10000];
while((string[i]=getc())!=EOF){
if (i<2){i++;
continue;
}
if((string[i]=='I')&&(string[i-1]=='O')&&(string[i-2]=='J')) joi++;
if((string[i]=='I')&&(string[i-1]=='O')&&(string[i-2]=='I')) ioi++;
i++;
}
printf(... | a.cc: In function 'int main()':
a.cc:7:30: error: too few arguments to function 'int getc(FILE*)'
7 | while((string[i]=getc())!=EOF){
| ~~~~^~
In file included from a.cc:1:
/usr/include/stdio.h:576:12: note: declared here
576 | extern int getc (FILE *__stream) __nonnull ((1)... |
s095372435 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cin>>s;
int ans1=0,ans2=0;
for(int i=0;i<s.size()-2;i++){
string t="";
t+=s[i];
t+=s[i+1];
t+=s[i+2];
if(t=="JOI")
ans1++;
if(t=="IOI")
ans2++;
}
cout>>ans1<<" "<<ans2<<endl;
} | a.cc: In function 'int main()':
a.cc:20:5: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
20 | cout>>ans1<<" "<<ans2<<endl;
| ~~~~^~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:5: note: candida... |
s306810411 | p00445 | C++ | #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(void)
{
char c[10000];
int len;
int joi=0, ioi=0;
scanf("%s",c);
len = strlen(c);
for(int i = 0 ; i < len ; i++) {
if(c[i] == 'J' && c[i+1] == 'O' && c[i+2] == 'I') joi++;
if(c[i] == 'I' && c[i+1] == 'O' && c[i+2... | a.cc: In function 'int main()':
a.cc:12:9: error: 'strlen' was not declared in this scope
12 | len = strlen(c);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#include <cstring>
3 | #inc... |
s932227284 | p00445 | C++ | #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(void)
{
char c[10000];
int len;
int joi=0, ioi=0;
while(scanf("%s",c) != EOF) {
len = strlen(c);
for(int i = 0 ; i < len ; i++) {
if(c[i] == 'J' && c[i+1] == 'O' && c[i+2] == 'I') joi++;
if(c[i] == ... | a.cc: In function 'int main()':
a.cc:12:11: error: 'strlen' was not declared in this scope
12 | len = strlen(c);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#include <cstring>
3 |... |
s781125846 | p00445 | C++ | bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp
#include<iostream>
#include<string>
using namespace std;
int main(){
string str;
int joi, ioi;
while(cin >> str){
joi = 0;
ioi = 0;
for(int i=0;i<str.size()-2;i++){
if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){
... | a.cc:1:7: error: stray '@' in program
1 | bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp
| ^
a.cc:1:1: error: 'bitoku' does not name a type
1 | bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp
| ^~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c+... |
s435855477 | p00445 | C++ | import java.util.*;
public class Main {
private void doit() {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
String str = sc.next();
HashMap<Character, Integer> map = new HashMap<Character, Integer>();
int len = str.length();
for(int i = 0; i < len; i++){
char te... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s964560353 | p00445 | C++ | #include<string>
int main(){
static char str[10010];
int i, len, joiCount = 0, ioiCount = 0;
scanf("%s", str);
len = strlen(str);
for(i = 2; i < len; i++){
if(str[i-2] == 'J' && str[i-1] == 'O' && str[i] == 'I'){
joiCount++;
}
if(str[i-2] == 'I' && str[i-1] == 'O' && str[i] == 'I'){
ioiCount++;
}
}... | a.cc: In function 'int main()':
a.cc:7:15: error: 'strlen' was not declared in this scope
7 | len = strlen(str);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<string>
+++ |+#include <cstring>... |
s018115186 | p00445 | C++ | #include <iostream>
using namespace std;
#include <string>
int main(){
string a;
int f;
cin >> a;
f=a.size()
int c;
c=0;
int d[f];
while(c<f){
string b(a,c,1);
if(b=="J"){d[c]=1;}
if(b=="O"){d[c]=2;}
if(b=="I"){d[c]=3;}
c=c+1;}
c=0;
int g;
int h;
g=0;
h=0;
while(c<10000){
if(d[c]==1){if(d[c+1]==2){if(d[c+2]==3){g=g+1... | a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before 'int'
10 | f=a.size()
| ^
| ;
11 | int c;
| ~~~
a.cc:12:1: error: 'c' was not declared in this scope
12 | c=0;
| ^
|
s079270075 | p00445 | C++ | #include <cstdio>
#include <cstring>
int main()
{
while(true) {
char str[20000];
if(scanf("%s", str) == EOF)
break;
int len = strlen(str);
int joi = 0. ioi = 0;
char joistr[] = "JOI", ioistr[] = "IOI";
for(int it = 0; it < len - 2; ++it) {
bool joivalid = true, ioivalid = true;
for(int i = 0; i < 3; ++i) {
if(joistr[i... | a.cc: In function 'int main()':
a.cc:11:14: error: expected ',' or ';' before 'ioi'
11 | int joi = 0. ioi = 0;
| ^~~
a.cc:22:16: error: 'ioi' was not declared in this scope; did you mean 'joi'?
22 | if(ioivalid) ++ioi;
| ^~~
| joi
a.cc:24:25: error: 'io... |
s324645756 | p00445 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string word;
int count;
while(cin>>word)
{
for(int i=0,count=0;(i=word.find("JOI",i))!=word.npos; i++)
count++;
cout<<count<<endl;
for(int i=0,count=0;(i=word.find("IOI",i))!=word.npos; i++)
numb++;
cout<<numb<<endl;
... | a.cc: In function 'int main()':
a.cc:18:25: error: 'numb' was not declared in this scope
18 | numb++;
| ^~~~
a.cc:19:31: error: 'numb' was not declared in this scope
19 | cout<<numb<<endl;
| ^~~~
|
s072884233 | p00445 | C++ | #include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(){
int joi,ioi;
char JOI[4]="JOI";
char IOI[4]="IOI";
char s[10004];
char than[4];
while(scanf("%s",s) != EOF){
joi=0;
ioi=0;
for(int i=0;s[i]!='\0';i++){
than[0] = s[i];
... | a.cc: In function 'int main()':
a.cc:19:16: error: 'strcmp' was not declared in this scope
19 | if(strcmp(than,JOI) == 0){
| ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdio>
+++ |+#in... |
s334278121 | p00445 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int n,JOI=0,IOI=0;
char s[10000];
while(scanf("%s",s)!=EOF){
n=strlen(s);
for(int i=0;i<n;i++){
if(s[i]=='J'){
if(s[i+1]=='O'){
if(s[i+2]=='I'){
JOI++;
}
}
}
else if(s[i]=='I'){
if(s[i+1]=='O'){
if(s[i+... | a.cc: In function 'int main()':
a.cc:8:7: error: 'strlen' was not declared in this scope
8 | n=strlen(s);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
+++ |+#include <cstring>
3 | using name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.