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

#include<string>
#include<cstring>
#include<iostream>
using namespace std;
int main(){
    string W,T;
    cin >> W;
    int n = 0;
    while(1){
        cin >> T;
        if (T == "END_OF_TEXT") break;
        if (toupper(T) == toupper(W)) n++;
    }
    cout << n;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: no matching function for call to 'toupper(std::string&)'
   12 |         if (toupper(T) == toupper(W)) n++;
      |             ~~~~~~~^~~
In file included 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:3:
/usr/include/c++/14/bits/locale_facets.h:2687:5: note: candidate: 'template<class _CharT> _CharT std::toupper(_CharT, const locale&)'
 2687 |     toupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/string:45,
                 from a.cc:1:
/usr/include/ctype.h:125:12: note: candidate: 'int toupper(int)'
  125 | extern int toupper (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:125:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  125 | extern int toupper (int __c) __THROW;
      |                     ~~~~^~~
a.cc:12:34: error: no matching function for call to 'toupper(std::string&)'
   12 |         if (toupper(T) == toupper(W)) n++;
      |                           ~~~~~~~^~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note: candidate: 'template<class _CharT> _CharT std::toupper(_CharT, const locale&)'
 2687 |     toupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:125:12: note: candidate: 'int toupper(int)'
  125 | extern int toupper (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:125:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  125 | extern int toupper (int __c) __THROW;
      |                     ~~~~^~~
Language: C++

#include<string>
#include<cctype>
#include<iostream>
using namespace std;
int main(){
    string W,T;
    cin >> W;
    int n = 0;
    while(1){
        cin >> T;
        if (T == "END_OF_TEXT") break;
        if (toupper(T) == toupper(W)) n++;
    }
    cout << n;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: no matching function for call to 'toupper(std::string&)'
   12 |         if (toupper(T) == toupper(W)) n++;
      |             ~~~~~~~^~~
In file included 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:3:
/usr/include/c++/14/bits/locale_facets.h:2687:5: note: candidate: 'template<class _CharT> _CharT std::toupper(_CharT, const locale&)'
 2687 |     toupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/string:45,
                 from a.cc:1:
/usr/include/ctype.h:125:12: note: candidate: 'int toupper(int)'
  125 | extern int toupper (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:125:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  125 | extern int toupper (int __c) __THROW;
      |                     ~~~~^~~
a.cc:12:34: error: no matching function for call to 'toupper(std::string&)'
   12 |         if (toupper(T) == toupper(W)) n++;
      |                           ~~~~~~~^~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note: candidate: 'template<class _CharT> _CharT std::toupper(_CharT, const locale&)'
 2687 |     toupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:125:12: note: candidate: 'int toupper(int)'
  125 | extern int toupper (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:125:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  125 | extern int toupper (int __c) __THROW;
      |                     ~~~~^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
    int n = 0;
    string W, T;
    cin >>W
    while(1){
        cin >>T;
        if(T == "END_OF_TEXT") break;
        for(int i=0; i<T.size(); i++){
            if(isupper(T[i])){
                T[i] = tolower(T[i]);
            }
        }
        if(W == T){
            n += 1;
        }
    }
    cout <<n << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before 'while'
    7 |     cin >>W
      |            ^
      |            ;
    8 |     while(1){
      |     ~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cctype>

using namespace std;

string toUpper(sring s){
    string t=s;
    for (int i=0; i<s.size(); i++){
        t[i] = toupper(s[i]);
    }
    return t;
}

int main(){
    string target,source;
    
    cin >> target;
    target = toUpper(target);
    
    int cnt = 0;
    while(1){
        cin >> source;
        if (source == "END_OF_TEXT") break;
        source = toUpper(source);
        if (target == source) cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc:7:16: error: 'sring' was not declared in this scope
    7 | string toUpper(sring s){
      |                ^~~~~
a.cc:7:24: error: expected ',' or ';' before '{' token
    7 | string toUpper(sring s){
      |                        ^
a.cc: In function 'int main()':
a.cc:19:21: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::string&)'
   19 |     target = toUpper(target);
      |              ~~~~~~~^~~~~~~~
a.cc:25:25: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::string&)'
   25 |         source = toUpper(source);
      |                  ~~~~~~~^~~~~~~~
Language: C++

#include<iosteam>
#include<string>

int main(){
    int cou =0;
    str n ;
    cin >>n;
    
    while(1){
        str a;
        cin >> a;
        if (a == "END_OF_TEXT") break;
        if(n==a){
            cou += 1;
        }
    }
    cout << cou;
    return 0;
}


Compiler output:
a.cc:1:9: fatal error: iosteam: No such file or directory
    1 | #include<iosteam>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>

int main(){
    int cou =0;
    str n ;
    cin >>n;
    
    while(1){
        str a;
        cin >> a;
        if (a == "END_OF_TEXT") break;
        if(n==a){
            cou += 1;
        }
    }
    cout << cou;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |     str n ;
      |     ^~~
      |     std
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin >>n;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:11: error: 'n' was not declared in this scope
    7 |     cin >>n;
      |           ^
a.cc:10:12: error: expected ';' before 'a'
   10 |         str a;
      |            ^~
      |            ;
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a;
      |                ^
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     cout << cou;
      |     ^~~~
      |     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<stdio.h>
#include<iostream>
#include<string>

using namespace std;
int main(){
    string t,w;
    int c,i;
    scanf("%s",&w);
    
    while(scanf("%s",&t) && (s != "END_OF_TEXT")){
        c = 0,i=0;
        if(int tm = t.find(w,i) && tm != -1){
            c++;
            i += tm + s.length() - 1;
        }
        
    }
    printf("%d",c);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: 's' was not declared in this scope
   11 |     while(scanf("%s",&t) && (s != "END_OF_TEXT")){
      |                              ^
Language: C++

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

using namespace std;
int main(){
    string t,w;
    int c,i;
    scanf("%s",&w);
    
    while(scanf("%s",&t) && (t != "END_OF_TEXT")){
        c = 0,i=0;
        if(int tm = t.find(w,i) && tm != -1){
            c++;
            i += tm + s.length() - 1;
        }
        
    }
    printf("%d",c);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: 's' was not declared in this scope
   15 |             i += tm + s.length() - 1;
      |                       ^
Language: C++

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

using namespace std;
int main(){
    string t,w;
    int c = 0,i;
    cin >> w;
    while(getline(cin,t) && (t != "END_OF_TEXT")){
        i = 0;
        while(1){
            int tm = t.find(w,i);
            if(tm === -1){
                break;
            }
            cout << tm << endl;
            c++;\
            i += tm + w.length() - 1;
        }
    }
    printf("%d",c);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected primary-expression before '=' token
   14 |             if(tm === -1){
      |                     ^
Language: C++

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

using namespace std;
int main(){
    string t,w;
    int c = 0,i;
    size_t pos;
    cin >> w;
    while((cin >> s) && (t != "END_OF_TEXT")){
        for(int i = 0;i < t.length();i++){
            if(t[i] >= 'A' && t[i] <= 'Z') t[i] += 'a' - 'A';
        }
        pos = 0;
        if(t == w) c++;
    }
    printf("%d\n",c);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 's' was not declared in this scope
   11 |     while((cin >> s) && (t != "END_OF_TEXT")){
      |                   ^
Language: C++

#include<cstdio>
#include<cctype>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    int a=0;
    int b=0;
    int c=0;
    string s,t;
    int ap;
    cin>>t
    while(1){
    cin>>s;
    if(s=="END_OF_TEXT") break;
    ap=s.find(t);
    if(ap!=-1)a+=1; 
    }
    cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: expected ';' before 'while'
   12 |     cin>>t
      |           ^
      |           ;
   13 |     while(1){
      |     ~~~~~
Language: C++

#include<cstdio>
#include<cctype>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    int a=0;
    string s,t;
    int ap;
    cin>>t;
    for(int i=0;i<=s.size;i++){
        t[i]=tolower(t[i])
    }
    while(1){
    cin>>s;
    if(s=="END_OF_TEXT") break;
    for(int i=0;i<=s.size;i++){
        s[i]=tolower(s[i])
    }
    ap=s.find(t);
    if(ap!=-1)a+=1; 
    }
    cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |     for(int i=0;i<=s.size;i++){
      |                    ~~^~~~
      |                          ()
a.cc:12:27: error: expected ';' before '}' token
   12 |         t[i]=tolower(t[i])
      |                           ^
      |                           ;
   13 |     }
      |     ~                      
a.cc:17:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   17 |     for(int i=0;i<=s.size;i++){
      |                    ~~^~~~
      |                          ()
a.cc:18:27: error: expected ';' before '}' token
   18 |         s[i]=tolower(s[i])
      |                           ^
      |                           ;
   19 |     }
      |     ~
Language: C++

#include<cstdio>
#include<cctype>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    int a=0;
    string s,t;
    int ap;
    cin>>t;
    for(int i=0;i<=s.size;i++){
        t[i]=tolower(t[i]);
    }
    while(1){
    cin>>s;
    if(s=="END_OF_TEXT") break;
    for(int i=0;i<=s.size;i++){
        s[i]=tolower(s[i]);
    }
    ap=s.find(t);
    if(ap!=-1)a+=1; 
    }
    cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |     for(int i=0;i<=s.size;i++){
      |                    ~~^~~~
      |                          ()
a.cc:17:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   17 |     for(int i=0;i<=s.size;i++){
      |                    ~~^~~~
      |                          ()
Language: C++

#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main(){
    string n, n2 ;
    cin >> n;
    
    int count = 0;
    
    while(1){
        cin >> n2;
        
        if(n2 = "END_OF_TEXT") break;
        
        for(int i = 0; i < n2.size(); i++){
            if(65 <= n2[i] && n2[i] <= 90){
                n2[i] += 32;
            }
        }
        
        if(n == n2){
            count++;
        }
    }
    
    cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: could not convert 'n2.std::__cxx11::basic_string<char>::operator=(((const char*)"END_OF_TEXT"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   14 |         if(n2 = "END_OF_TEXT") break;
      |            ~~~^~~~~~~~~~~~~~~
      |               |
      |               std::__cxx11::basic_string<char>
Language: C++

#include<cstdio>
#include<ctype>
#include<cstring>

int main(){
    char W[10], T[1000];
    int count=0;
    
    while(1){
        scanf("%s %s", &W, &T);
        if (strstr(T, "END_OF_TEXT")) break;
        if (strstr(T, W)) count+=1;
    }
    
    printf(count);
    
    return 0;
    
}


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

#include<cstdio>
#include<cctype>
#include<cstring>

int main(){
    char W[10], T[1000];
    int count=0;
    
    while(1){
        scanf("%s %s", &W, &T);
        if (strstr(T, "END_OF_TEXT")) break;
        if (strstr(T, W)) count+=1;
    }
    
    printf(count);
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   15 |     printf(count);
      |            ^~~~~
      |            |
      |            int
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
        char w[10],t[1000];
        int ans=0;
        scanf("%s",w);
        while(scanf("%s",t) && strcmp(t, "END_OF_TEXT") != 0){
                for(int i=0;i<strlen(t);i++) t[i]='A'<=t[i] && 'Z'>=t[i]?t[i]-'A'+'a':t[i];
                if(strcmp(t,w)==0) ans++;
        }
        printf("%d\n",ans);
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'strcmp' was not declared in this scope
   13 |         while(scanf("%s",t) && strcmp(t, "END_OF_TEXT") != 0){
      |                                ^~~~~~
a.cc:7:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<algorithm>
  +++ |+#include <cstring>
    7 | using namespace std;
a.cc:14:31: error: 'strlen' was not declared in this scope
   14 |                 for(int i=0;i<strlen(t);i++) t[i]='A'<=t[i] && 'Z'>=t[i]?t[i]-'A'+'a':t[i];
      |                               ^~~~~~
a.cc:14:31: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main () {
    string T, S, count;
    cin >> S;
    while(T != "END_OF_TEXT") {
        cin >> T;
        if(T == S)
            count++;
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |             count++;
      |             ~~~~~^~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main () {
    string T, S;
    int count = 0, i;
    cin >> S;
    while(T != "END_OF_TEXT") {
        cin >> T;
        for (i=0;i < T.size(); i++)
            if(T[i]>= 'A' && T[i] <= 'Z')
                T[i] += 32
        if(T == S)
            count++;
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: expected ';' before 'if'
   14 |                 T[i] += 32
      |                           ^
      |                           ;
   15 |         if(T == S)
      |         ~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main () {
    string T, S;
    int count = 0, i;
    cin >> S;
    while(T != "END_OF_TEXT") {
        cin >> T;
        for (i=0;i < T.size(); i++) {
            if(T[i]>= 'A' && T[i] <= 'Z')
                T[i] += 32
        }
        if(T == S)
            count++;
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: expected ';' before '}' token
   14 |                 T[i] += 32
      |                           ^
      |                           ;
   15 |         }
      |         ~
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <string>

using namespace std;

int main()
{
	char W[10], T[100];
	int count = 0;

	cin >> W;

	while (1) {
		cin >> T;
		if (strcmp(W, T) == 0) count++;
		if (strcmp("END_OF_TEXT", T) == 0) break;
	}
	printf("%d\n", count);

	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'strcmp' was not declared in this scope
   16 |                 if (strcmp(W, T) == 0) count++;
      |                     ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | #include <string>
a.cc:17:21: error: 'strcmp' was not declared in this scope
   17 |                 if (strcmp("END_OF_TEXT", T) == 0) break;
      |                     ^~~~~~
a.cc:17:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>
#include <cctype>

using namespace std;

int main()
{
	char W[10], T[100];
	int count = 0;

	cin >> W;

	while (1) {
		cin >> T;
		if (strcmp(W, T) == 0) count++;
		if (strcmp("END_OF_TEXT", T) == 0) break;
	}
	printf("%d\n", count);

	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: 'strcmp' was not declared in this scope
   23 |                 if (strcmp(W, T) == 0) count++;
      |                     ^~~~~~
a.cc:11:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cctype>
  +++ |+#include <cstring>
   11 | 
a.cc:24:21: error: 'strcmp' was not declared in this scope
   24 |                 if (strcmp("END_OF_TEXT", T) == 0) break;
      |                     ^~~~~~
a.cc:24:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

string word;
string par;

int cnt;

void inp(){
	cin >> word;
	string line;
	while(true){
		cin >> line;
		if(!cin.compare("END_OF_TEXT")) break;
		transform(line.begin(),line.end(),str.begin(),::toupper);
		cnt += !cin.compare(word);
	}
}

int main(){
	inp();
	printf("%d\n",cnt);
}

Compiler output:
a.cc: In function 'void inp()':
a.cc:17:25: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'compare'
   17 |                 if(!cin.compare("END_OF_TEXT")) break;
      |                         ^~~~~~~
a.cc:18:51: error: 'str' was not declared in this scope; did you mean 'std'?
   18 |                 transform(line.begin(),line.end(),str.begin(),::toupper);
      |                                                   ^~~
      |                                                   std
a.cc:19:29: error: 'std::istream' {aka 'class std::basic_istream<char>'} has no member named 'compare'
   19 |                 cnt += !cin.compare(word);
      |                             ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
	string w, s;
	cin >> w;

	int t = 0;
	while( cin >> s )
	{
		if( s == "END_OF_TEXT" ) 
			break;
		
		if( 0 == stricmp( w.c_str(), s.c_str()))
			++t;
	}

	cout << t << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: 'stricmp' was not declared in this scope
   16 |                 if( 0 == stricmp( w.c_str(), s.c_str()))
      |                          ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
	string w, s;
	cin >> w;

	int t = 0;
	while( cin >> s )
	{
		if( s == "END_OF_TEXT" ) 
			break;
		
		if( 0 == _stricmp( w.c_str(), s.c_str()))
			++t;
	}

	cout << t << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: '_stricmp' was not declared in this scope
   16 |                 if( 0 == _stricmp( w.c_str(), s.c_str()))
      |                          ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main()
{
	string w, s;
	cin >> w;

	int t = 0;
	while( cin >> s )
	{
		if( s == "END_OF_TEXT" ) 
			break;
		
		if( 0 == _stricmp( w.c_str(), s.c_str()))
			++t;
	}

	cout << t << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: '_stricmp' was not declared in this scope; did you mean 'strncmp'?
   16 |                 if( 0 == _stricmp( w.c_str(), s.c_str()))
      |                          ^~~~~~~~
      |                          strncmp
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
    string W, T;
    int count = 0;
    
    cin >> W;
    
    while(1){
        cin >> T;
        if(T == "END_OF_TEXT"){
            break;
        }
        if(_stricmp(T.c_str(), W.c_str()) == 0){
            count++;
        }
    }
    cout << count << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: '_stricmp' was not declared in this scope
   17 |         if(_stricmp(T.c_str(), W.c_str()) == 0){
      |            ^~~~~~~~
Language: C++

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

int main(){
    string W, T;
    int count = 0;
    
    cin >> W;
    transform(W.brgin(), W.end(), W.begin() ::toupper); 
    
    while(1){
        cin >> T;
        if(T == "END_OF_TEXT"){
            break;
        }
        
        transform(T.brgin(), T.end(), T.begin() ::toupper); 
        if(T == W){
            count++;
        }
    }
    cout << count << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'brgin'; did you mean 'begin'?
   13 |     transform(W.brgin(), W.end(), W.begin() ::toupper);
      |                 ^~~~~
      |                 begin
a.cc:13:44: error: expected ')' before '::' token
   13 |     transform(W.brgin(), W.end(), W.begin() ::toupper);
      |              ~                             ^~~
      |                                            )
a.cc:21:21: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'brgin'; did you mean 'begin'?
   21 |         transform(T.brgin(), T.end(), T.begin() ::toupper);
      |                     ^~~~~
      |                     begin
a.cc:21:48: error: expected ')' before '::' token
   21 |         transform(T.brgin(), T.end(), T.begin() ::toupper);
      |                  ~                             ^~~
      |                                                )
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  char s,in;
  int i;
  cin >> s;

  while (cin >> in) {
    if (in == 'END_OF_TEXT') {
      break;
    }
    if (s == in) {
      i++;
    }
  }
  cout << i << endl;
  return 0
}

Compiler output:
a.cc:12:15: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   12 |     if (in == 'END_OF_TEXT') {
      |               ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:20:11: error: expected ';' before '}' token
   20 |   return 0
      |           ^
      |           ;
   21 | }
      | ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  string in, s;
  int i = 0;
  cin >> s;

  while (cin >> in) {
    if (in == "END_OF_TEXT") {
      break;
    }
    if (0 == strcmpi(s, in)) {
      i++;
    }
  }
  cout << i << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: 'strcmpi' was not declared in this scope
   15 |     if (0 == strcmpi(s, in)) {
      |              ^~~~~~~
Language: C++

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

int main(){
	string str;
	string word;
	int cnt = 0;
	cin >> word;
	string::iterator wp, sp;
	wp = word.begin();
	while(wp != word.end()){
		*wp = tolower(*wp);
		wp++;
	}
	while(true){
		cin>>str;
		if(string::npos != str.find("END_OF_TEXT",0)) break;
		sp = str.begin();
		while(sp != str.end()){
			*sp = tolower(*sp);
			sp++;
		}
		if(str == word) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

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

#include<iostream>
#include<string>

int main(){
	int n = 0;
	string W, T;
	cin >> W;
	while(1){
		cin >> T;
		if(T == "END_OF_TEXT") break;
		if(T == W){
			n = n++;
		}
	}
	cout << n << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string W, T;
      |         ^~~~~~
a.cc:6:9: 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:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> W;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:16: error: 'W' was not declared in this scope
    7 |         cin >> W;
      |                ^
a.cc:9:24: error: 'T' was not declared in this scope
    9 |                 cin >> T;
      |                        ^
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << n << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |         cout << n << endl;
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
	int n = 0;
	string W, T;
	cin >> W;
	while(1){
		cin >> T;
		if(T == END_OF_TEXT) break;
		if(T == W){
			n = n + 1;
		}
	}
	cout << n << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'END_OF_TEXT' was not declared in this scope
   11 |                 if(T == END_OF_TEXT) break;
      |                         ^~~~~~~~~~~
Language: C++

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

int main(){
	int n = 0;
	string W, T;
	cin >> W;
	while(1){
		cin >> T;
		if(T == "END_OF_TEXT") break;
		for(i = 0; i < T.size(); i++){
			int tolower(T);
			if(T == W){
			n = n + 1;
		}
	}
	cout << n << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'i' was not declared in this scope
   13 |                 for(i = 0; i < T.size(); i++){
      |                     ^
a.cc:14:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   14 |                         int tolower(T);
      |                                     ^
      |                                     |
      |                                     std::string {aka std::__cxx11::basic_string<char>}
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main(){
	int n = 0;
	string W, T;
	cin >> W;
	while(1){
		cin >> T;
		if(T == "END_OF_TEXT") break;
		for(int i = 0; i < T.size(); i++){
			T = tolower(T);
			if(T == W){
				n = n + 1;
			}
		}
	}
	cout << n << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: no matching function for call to 'tolower(std::string&)'
   14 |                         T = tolower(T);
      |                             ~~~~~~~^~~
In file included 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/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
Language: C++

#include <iostream>
using namespace std;
string lower(string str);

main(){
	int count=0;
	string W,T;
	cin>>W;
	W=lower(W);
	while(cin>>T&&T!="END_OF_TEXT"){
		int index=0;
		if(W==lower(T)){
			count++;
		}
	}
	cout<<count<<endl;
}

string lower(string str){
	int length=str.length();
	for(int i=0;i<length;i++){
		if('A'<=s[i]&&s[i]<='Z'){
			s[i]+=0x20;
		}
	}
	return str;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'std::string lower(std::string)':
a.cc:22:25: error: 's' was not declared in this scope
   22 |                 if('A'<=s[i]&&s[i]<='Z'){
      |                         ^
Language: C++

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

int main(){
	string w;
	string t;
	char* tmp1 , *tmp2 , *tmp3;
	int count=0;
	cin>>w;
	tmp2=(char*)w.c_str();
	cin.ignore();
	while(1){
	getline(cin , t);
		if(t=="END_OF_TEXT") break;
		tmp1=(char*)t.c_str();
		for(int i=0 ; i<t.size(); i++){
			tmp3=strstr(tmp1,tmp2);
			if(tmp3==NULL){
				break; 
			} else {
				count++;
				tmp1=tmp3+1;
			}
		}
		t.erase();
	}
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'strstr' was not declared in this scope
   18 |                         tmp3=strstr(tmp1,tmp2);
      |                              ^~~~~~
a.cc:2:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main(){
   string W,T;
   int i=0;

   cin >> W;
   W = tolower(W);

   while(cin >> T,T != "END_OF_TEXT"){
	T = tolower(T);
	if(text == W) i++;
   }
	cout << i << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no matching function for call to 'tolower(std::string&)'
   10 |    W = tolower(W);
      |        ~~~~~~~^~~
In file included 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/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
a.cc:13:20: error: no matching function for call to 'tolower(std::string&)'
   13 |         T = tolower(T);
      |             ~~~~~~~^~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
a.cc:14:12: error: 'text' was not declared in this scope
   14 |         if(text == W) i++;
      |            ^~~~
Language: C++

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

int main(){
   string W,T;
   int i=0;

   cin >> W;
   W = tolower(W);

   while(cin >> T,T != "END_OF_TEXT"){
	T = tolower(T);
	if(text == W) i++;
   }
	cout << i << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: no matching function for call to 'tolower(std::string&)'
   11 |    W = tolower(W);
      |        ~~~~~~~^~~
In file included 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/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
a.cc:14:20: error: no matching function for call to 'tolower(std::string&)'
   14 |         T = tolower(T);
      |             ~~~~~~~^~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
a.cc:15:12: error: 'text' was not declared in this scope
   15 |         if(text == W) i++;
      |            ^~~~
Language: C++

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

int main(){
	
	string a, b;
	int n = 0, m = 0;
	
	getline( cin , a ) ;
	
	for(int i = 0; i < a.size(); ++i){
		
		if(a[i] >= 'A' && a[i] <= 'Z'){
			
			a[i] += 'a' - 'A' ;
		}
	}
	while(1){
		
		getline(cin, b);
		
		f(b == "END_OF_TEXT") break;
		
		for(int i = 0; i < b.size(); ++i){
		
			if(b[i] >= 'A' && b[i] <= 'Z'){
			
				b[i] += 'a' - 'A';
			}
		}
		
		
		for(int i = 0; i < b.size()-a.size(); ++i){
			for(int j = 0; j < a.size(); ++j){
				if(a[j] == b[i+j])++m;
			}
			
			if(m == a.size())++n;
			m = 0;
		}
	}
	
	cout << n << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'f' was not declared in this scope
   23 |                 f(b == "END_OF_TEXT") break;
      |                 ^
Language: C++

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

int main(){
	
	string a, b;
	int n = 0;
	
	getline( cin , a ) ;
	
	for(int i = 0; i < a.size(); ++i){
		
		if(a[i] >= 'A' && a[i] <= 'Z'){
			
			a[i] += 'a' - 'A' ;
		}
	}
	while(1){
		
		cin >> b;
		
		if(b == "END_OF_TEXT") break;
		
		for(int i = 0; i < b.size(); ++i){
		
			if(b[i] >= 'A' && b[i] <= 'Z'){
			
				b[i] += 'a' - 'A';
			}
		}
		
		if(b == a) ++n;
	
	cout << n << endl;
	
	return 0;
}

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

#include <iostream>
using namespace std;

int main()
{
    string w, t;
    int count = 0;

    cin >> w;
    transform(w.begin(), w.end(), w.begin(), ::tolower);

    while (cin >> t) {
        transform(t.begin(), t.end(), t.begin(), ::tolower);

        if (t.compare(w) == 0) {
            count++;
        }
    }

    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'transform' was not declared in this scope
   10 |     transform(w.begin(), w.end(), w.begin(), ::tolower);
      |     ^~~~~~~~~
Language: C++

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

int main()
{
    string w, t;
    int count = 0;

    cin >> w;
    transform(w.begin(), w.end(), w.begin(), ::tolower);

    while (cin >> t) {
        transform(t.begin(), t.end(), t.begin(), ::tolower);

        if (t.compare(w) == 0) {
            count++;
        }
    }

    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'transform' was not declared in this scope
   11 |     transform(w.begin(), w.end(), w.begin(), ::tolower);
      |     ^~~~~~~~~
Language: C++

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

string upper(string str){
    for(int i = 0;i < str.size();i++){
		if ('a' <= str[i] && str[i] <= 'z')
    	{
    		str[i] = (str[i] - 'a' + 'A');
    	}
    }
    return str;
}

int main(){
	string W,S,T;
	int j,ans;
	cin >> W;
	do{
		S += T;
		getline(cin,T);
	}while(T != "END_OF_TEXT");
	W = upper(W);
	S = upper(S);
	for(int i=0,i < S.size(); i++){
		if(S[i] == W[j]){
			j++;
		}else{
			j = 0;
		}
		if(j == W.size()){
			ans ++;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before '<' token
   25 |         for(int i=0,i < S.size(); i++){
      |                      ^~
      |                      ;
a.cc:25:23: error: expected primary-expression before '<' token
   25 |         for(int i=0,i < S.size(); i++){
      |                       ^
Language: C++

#include <iostream>
using namespace std;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#define NUM 200

int main()
{
   static long i,j,k,l;
   static char p[1005];
   static char s[13];
   static char ch;
   static int sum[26];
   static char r[12] = "END_OF_TEXT";
   int cnt = 0;
   char ok;
   char end = 0;
   fgets(s,13,stdin);

   while(end == 0) {
      fgets(p,1010,stdin);
      for(i=0;p[i];i++) {
         if('a' <= p[i] && p[i]<= 'z' ||
            'A' <= p[i] && p[i]<= 'Z') {
               if(p[i] == r[0]) {
                  end = 1;
                  for(j=0;r[j];j++) {
                     if(p[i+j] != r[j]) {
                        end=0;break;
                     }
                  }
                  if(end)
                     break;
               }
               if(tolower(p[i]) == tolower(s[0])) {
                  ok = 1;
                  j = i;
                  for(;s[i-j] != '\n';i++) {
                     if(tolower(p[i]) != tolower(s[i-j])) {
                        ok=0;i--; break; 
                     }
                  }
                  if(ok) {
                     cnt++;
                     i--;
                  }
               }
         }
         for(;;i++){
            if('a' <= p[i] && p[i]<= 'z' ||
            'A' <= p[i] && p[i]<= 'Z');
            else break;
         }
      }
   }
   fclose(fp);
   cout << cnt;
   cout << endl;




   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:11: error: 'fp' was not declared in this scope; did you mean 'p'?
   59 |    fclose(fp);
      |           ^~
      |           p
Language: C++

#include <cstdio>
#include <iostream>
#include <cctype>
#include <cstring>
using namespace std;
string Toupper(string s){
  string t=s;
  for(int i=0;i<s.size();i++){
    t[i]=toupper(s[i]);
  }
  return t;
}
int main(){
  string target,source;
  cin>>target
  target=Toupper(target);
  int count=0;
  while(1){
    cin>>source;
    if(source=="END_OF_TEXT") break;
    source=Toupper(source);
    if(target==source) count+=1;
  }
  printf("%d",count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before 'target'
   15 |   cin>>target
      |              ^
      |              ;
   16 |   target=Toupper(target);
      |   ~~~~~~
Language: C++

/* ITP1_9_A: Finding a Word */

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

const string EOF_STR = "END_OF_TEXT";

int main() {
    std::ios::sync_with_stdio(false);

    string target;
    std::cin >> target;

    int n_targets = 0;
    string word;
    while (std::cin) {
        std::cin >> word;
        std::transform(word.begin(), word.end(), word.begin(), ::tolower);
        if (word == EOF_STR)
            break;
        if (word == target)
            n_targets++;
    }
    std::cout << n_targets << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'transform' is not a member of 'std'
   19 |         std::transform(word.begin(), word.end(), word.begin(), ::tolower);
      |              ^~~~~~~~~
Language: C++

w = input().lower()
n = 0
while True:
    t = input()
    if t == 'END_OF_TEXT': break
    n += t.lower().split().count(w)
print(n)

Compiler output:
a.cc:5:13: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
    5 |     if t == 'END_OF_TEXT': break
      |             ^~~~~~~~~~~~~
a.cc:1:1: error: 'w' does not name a type
    1 | w = input().lower()
      | ^
Language: C++

import java.io.*;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String w = br.readLine();
        String t = "";
        int count = 0;
        while(!(t = br.readLine()).equals("END_OF_TEXT")){
            t.toLowerCase();
            String[] words = t.split(" ");
            for(int i=0; i < words.length; i++){
                if(words[i].equals(w)){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
 
}

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