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

using System;

namespace Ssearch
{
    class Program
    {
        static void Main(string[] args)
        {
            string word = Console.ReadLine();
            int f = 0;
            while(true)
            {
                string s = Console.ReadLine();
                if (s == "END_OF_TEXT")
                {
                    break;
                }
                s = s + " ";
                int foundIndex = s.IndexOf(word, StringComparison.OrdinalIgnoreCase);
                while (foundIndex >= 0)
                {

                    ++f;
                    //?¬????????´¢????§???????
                    int nextIndex = foundIndex + word.Length;
                    if (nextIndex < s.Length)
                    {
                        //?¬???????????????¢???
                        foundIndex = s.IndexOf(word, nextIndex, StringComparison.OrdinalIgnoreCase);
                    }
                    else
                    {
                        //???????????§????´¢????????¨???????????????
                        break;
                    }
                }
            }
            Console.WriteLine(f);
        }
    }

}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:40:6: error: expected ';' after class definition
   40 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void Ssearch::Program::Main(int*)':
a.cc:9:13: error: 'string' was not declared in this scope
    9 |             string word = Console.ReadLine();
      |             ^~~~~~
a.cc:13:24: error: expected ';' before 's'
   13 |                 string s = Console.ReadLine();
      |                        ^
a.cc:14:21: error: 's' was not declared in this scope
   14 |                 if (s == "END_OF_TEXT")
      |                     ^
a.cc:18:17: error: 's' was not declared in this scope
   18 |                 s = s + " ";
      |                 ^
a.cc:19:44: error: 'word' was not declared in this scope
   19 |                 int foundIndex = s.IndexOf(word, StringComparison.OrdinalIgnoreCase);
      |                                            ^~~~
a.cc:19:50: error: 'StringComparison' was not declared in this scope
   19 |                 int foundIndex = s.IndexOf(word, StringComparison.OrdinalIgnoreCase);
      |                                                  ^~~~~~~~~~~~~~~~
a.cc:38:13: error: 'Console' was not declared in this scope
   38 |             Console.WriteLine(f);
      |             ^~~~~~~
Language: C++

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

int main(void){
	int count = 0;
	string W, T; 
	cin >> W;//?????????W?????\?????????????????§?????????
	
	for (int i = 0; i < W.size; i++)W[i] = tolower(W[i]);
	while (true){
		cin >> T;
		if (T == "END_OF_TEXT") break;
		for (int i = 0; i < T.size; i++)T[i] = tolower(T[i]);
		if (W == T) count++;
	}
	cout << count << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: 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 '()' ?)
   10 |         for (int i = 0; i < W.size; i++)W[i] = tolower(W[i]);
      |                             ~~^~~~
      |                                   ()
a.cc:14:39: 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 '()' ?)
   14 |                 for (int i = 0; i < T.size; i++)T[i] = tolower(T[i]);
      |                                     ~~^~~~
      |                                           ()
Language: C++

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

int main(void)
{	
	char w[11] = "\0";
	cin >> w;
	
	int cnt = 0;
	while (1) {
		char buf[1001] = "\0";
		cin >> buf;
		if (strcmp(buf, "END_OF_TEXT") == 0) break;
		buf = tolower(buf);
		if (strcmp(buf, w) == 0) cnt++;
	}
	
	cout << cnt << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: no matching function for call to 'tolower(char [1001])'
   17 |                 buf = tolower(buf);
      |                       ~~~~~~~^~~~~
In file included from a.cc:3:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)' (near match)
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:12: note:   conversion of argument 1 would be ill-formed:
a.cc:17:31: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   17 |                 buf = tolower(buf);
      |                               ^~~
      |                               |
      |                               char*
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:4:
/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
Language: C++

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

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

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

Compiler output:
a.cc: In function 'std::string toUpper(std::string)':
a.cc:11:1: error: return-statement with no value, in function returning 'std::string' {aka 'std::__cxx11::basic_string<char>'} [-fpermissive]
   11 | return ;
      | ^~~~~~
Language: C++

#include<string>
using namespace std;
int main()
{
  string a,b;
  int d = 0;
  cin >> a; 
  while(cin>>b,b!= "END_OF_TEXT"){
    int l = b.size();
    for(int i = 0; i < l; i++) b[i] = tolower(b[i]);
    if(a == b) d++;
  }
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> a;
      |   ^~~
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>
    2 | using namespace std;
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << d << endl;
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |   cout << d << endl;
      |                ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

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

int main(){
	string w,t;
	int counter=0;
	cin>>w;
	for(int i=0;w[i]!=w.length();i++){
		if(islower(w[i])) w[i]=toupper(w[i]);
	}
	while(cin>>t){
		if(t=="END_OF_TEXT"){
			cout<<counter<<endl;
			break;
		}
		for(int i=0;i<t.length();i++){
			if(islower(t[i]) t[i]=toupper(t[i]);
		}
		if(t==w) counter++;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:41: error: expected ';' before 't'
   18 |                         if(islower(t[i]) t[i]=toupper(t[i]);
      |                                         ^~
      |                                         ;
a.cc:19:17: error: expected primary-expression before '}' token
   19 |                 }
      |                 ^
a.cc:18:61: error: expected ')' before '}' token
   18 |                         if(islower(t[i]) t[i]=toupper(t[i]);
      |                           ~                                 ^
      |                                                             )
   19 |                 }
      |                 ~                                            
a.cc:19:17: error: expected primary-expression before '}' token
   19 |                 }
      |                 ^
Language: C++

/*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_A
 */
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

template <typename T_char>
T_char
ToLower(T_char c)
{
  return tolower(c);
}

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

  string W;
  getline(cin, W);

  int count = 0;
  while (true) {
    string line;
    getline(cin, line);

    if (line == "END_OF_TEXT") {
      break;
    }
    transform(line.begin(), line.end(), line.begin(), ToLower<char>);
    int pos = 0;
    while (true) {
      size_t found = line.find(W, pos);
      if (found == string::npos) {
	break;
      }
      count++;
      pos = found W.length();
    }
  }
  cout << count << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:18: error: expected ';' before 'W'
   41 |       pos = found W.length();
      |                  ^~
      |                  ;
Language: C++

#include <cstring>
#include <clocale>
#include <string>
#include <iostream>

int main()
{
    std::string W;
    std::cin >> W;
    int C = 0;
    while(true){
        std::string Ti;
        std::cin >> Ti;
        if(Ti == "END_OF_TEXT") break;
        if(std::stricmp(Ti.c_str(), W.c_str()) == 0) C++;
    }
    std::cout << C << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'stricmp' is not a member of 'std'; did you mean 'strncmp'?
   15 |         if(std::stricmp(Ti.c_str(), W.c_str()) == 0) C++;
      |                 ^~~~~~~
      |                 strncmp
Language: C++

#include <iostream>

using namespace std;

int main ()
{
	char a[1000],A[1000];
	int n;

	cin >> a;

	for (int f = 1 ; f < 1000; f++)
	{
		cin >> A[f];

		if (A[f] == a[f])
		{
			n += 1;
			cout << "aqaa";
		}

		if (A[f] == "END_OF_TEST")
		{
			break;
		}
	}
	cout << n << endl;

	cout << "mmmmmm";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (A[f] == "END_OF_TEST")
      |                     ~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
	string str; cin >> str;
	string s, st;
	while (cin >> st)if (st == "END_OF_TEXT")break; else s += st;
	int sum = 0;
	for (int i = 0; i < s.size - str.size(); i++) {
		if (s.substr(i, str.size()) == str) {
			sum++;
			i += str.size() - 1;
		}
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: 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 '()' ?)
    9 |         for (int i = 0; i < s.size - str.size(); i++) {
      |                             ~~^~~~
      |                                   ()
Language: C++

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

int main(){
	int i,j,count,wn,tn;
	string w,t;
	cin >> w;
	cin >> t;
	wn=w.size();
	tn=t.size();
	while(i!=tn){
		if(islower(w[i])){
			w[i]=toupper(w[i])
		}
		if(islower(t[j])){
			t[j]=toupper(t[j])
		}
		if(t[i] == '\n'){
			break;
		}
		if(t[i]==w[j]){
			j++;
			if(j==wn){
				j=0;
				count++;
			}
		}
		if(j!=0 && t[i]!=w[j]){
			j=0;
		}
		i++;
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:43: error: expected ';' before '}' token
   14 |                         w[i]=toupper(w[i])
      |                                           ^
      |                                           ;
   15 |                 }
      |                 ~                          
a.cc:17:43: error: expected ';' before '}' token
   17 |                         t[j]=toupper(t[j])
      |                                           ^
      |                                           ;
   18 |                 }
      |                 ~
Language: C++

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

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

 cint >> w ;
 for(int i=0;i<w.length();i++){
  w[i]=tolower(w[i]);
 }

 while (1){
  cin >> t ;
  if(t == "END_OF_TEXT")break;
  for(int i=0;i<t.length();i++){
   t[i]=tolower(t[i]);
  }

  if(t==w)cnt++;
 }
 
 cout << cnt << endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:2: error: 'cint' was not declared in this scope; did you mean 'cnt'?
    9 |  cint >> w ;
      |  ^~~~
      |  cnt
Language: C++

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

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

 cint >> w ;

 while (1){
  cin >> t ;
  if(t == "END_OF_TEXT")break;
  for(int i=0;i<t.length();i++){
   t[i]=tolower(t[i]);
  }

  if(t==w)cnt++;
 }
 
 cout << cnt << endl;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:2: error: 'cint' was not declared in this scope; did you mean 'cnt'?
    9 |  cint >> w ;
      |  ^~~~
      |  cnt
Language: C++

#include <stdio.h>
int main(){
    char p[11],x[10000],temp;
    for(int i=0;i<11;i++)
        p[i];
    int m=0,n=0;
    bool f;
    scanf("%s",p);
while(scanf("%c",&temp)!=EOF){
if(temp-'A'>=0&&temp-'A'<26)temp+=32;
x[m]=temp;
m++;
}
    while(p[n]!='\0')n++;
    for(int i=m;i<m*2;i++){
        x[i]=x[i-m];
    }
    for(int i=0;i<m;i++){
        f=true;
        for(int j=0;j<n&&f;j++){
            if(p[j]!=x[j+i])f=false;
               }
               if(f){
                  ans++;
               }
               }
               printf("%d\n",ans);
               }

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'ans' was not declared in this scope
   24 |                   ans++;
      |                   ^~~
a.cc:27:30: error: 'ans' was not declared in this scope
   27 |                printf("%d\n",ans);
      |                              ^~~
Language: C++

#include <stdio.h>
#include <ctype.h>
#include <string.h>
int main(){
  char W[10],T[1000];
  int count=0,i;
  scanf("%s",W)
  while(1){
    scanf(" %s",T);
    if(strcmp(T,"END_OF_TEXT")==0){
      break;
    }
    for(i=0;W[i]!='\0';i++){
      T[i]=tolower(T[i]);
    }
    if(strcmp(T,W)==0){
      count++;
    }
  }
  printf("%d\n",count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before 'while'
    7 |   scanf("%s",W)
      |                ^
      |                ;
    8 |   while(1){
      |   ~~~~~
Language: C++

#include <iostream>
#include <string>

int main() {
  std::string word
  std::string text
  std::getline(std::cin, text);

  int cnt = 0;
  while(1) {
    std::getline(std::cin, text);
    if(str == "END_OF_TEXT") break;
    while(std::getline(text, buf)) {
      if(word == buf) cnt++;
    }
  }
  std::cout << cnt << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'std'
    6 |   std::string text
      |   ^~~
a.cc:11:28: error: 'text' was not declared in this scope
   11 |     std::getline(std::cin, text);
      |                            ^~~~
a.cc:12:8: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |     if(str == "END_OF_TEXT") break;
      |        ^~~
      |        std
a.cc:13:30: error: 'buf' was not declared in this scope
   13 |     while(std::getline(text, buf)) {
      |                              ^~~
a.cc:14:10: error: 'word' was not declared in this scope
   14 |       if(word == buf) cnt++;
      |          ^~~~
Language: C++

#include <iostream>
#include <string>

int main() {
  std::string word;
  std::string text;
  std::getline(std::cin, word);

  int cnt = 0;
  while(1) {
    std::getline(std::cin, text);
    if(text == "END_OF_TEXT") break;
    for(int i = 0; text[i] != '0'; ++i) {
      if(isupper(text[i])) text[i] = tolowwer(text[i]);
    }

    if(text == word) cnt++;
  }
  std::cout << cnt << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:38: error: 'tolowwer' was not declared in this scope; did you mean 'tolower'?
   14 |       if(isupper(text[i])) text[i] = tolowwer(text[i]);
      |                                      ^~~~~~~~
      |                                      tolower
Language: C++

#include <iostream>

using namespace std;

int main() {
    string W, T;
    int count = 0;
    cin >> W;

    while (true) {
        cin >> T;
        if (T == "END_OF_TEXT") {
            break;
        }
        transform(T.begin(), T.end(), T.begin(), ::tolower);

        if (T.find(W) != string::npos) {
            count++;
        }
    }

    cout << count;
}

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

#include <iostream>

using namespace std;

int main() {
    string W, T;
    int count = 0;
    cin >> W;

    while (true) {
        cin >> T;
        if (T == "END_OF_TEXT") {
            break;
        }
        transform(T.begin(), T.end(), T.begin(), ::tolower);
        if (T.find(W) != string::npos) {
            count++;
        }
    }

    cout << count;
}

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

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

int main() {
    string W, T;
    int count = 0;
    cin >> W;

    while (true) {
        cin >> T;
        if (T == "END_OF_TEXT") {
            break;
        }
        transform(T.begin(), T.end(), T.begin(), ::tolower);
        if (T.find(W) != string::npos) {
            count++;
        }
    }

    cout << count;
}

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

#include <iostream>
#include <string>

using namespace std;

int main() {
    string W, T;
    int count = 0;
    cin >> W;

    while (true) {
        cin >> T;
        if (T == "END_OF_TEXT") {
            break;
        }
        transform(T.begin(), T.end(), T.begin(), ::tolower);
        if (!(T.find(W) == string::npos)) {
            count++;
        }
    }

    cout << count;
}

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

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

using namespace std;
int main()
{
	char T,W[100];
	int count=0;
	int answer = 0;
	cin >> W;
	while (cin >> T)//????????????while(scanf("%c",&T)!=EOF);?
	{
		if (T == W[count]) {
			count++;
			if (count == strlen(W)) {
				answer++;
				count = 0;
			}
		}
		else {
			count = 0;
			
		}

	}
	cout << answer << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: 'strlen' was not declared in this scope
   17 |                         if (count == strlen(W)) {
      |                                      ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cctype>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
string t=' ';

int main (){
	int c, cnt =0;
	string w;
	string  one;
	cin >> w;
	while(1){
		cin >> one;
		t+=one;
		t+=' ';
		if (one=="END_OF_TEXT")
			break;

	}

	while (t.find(w)<t.size() and t.find(w)>=0)
	{
		cnt++;
		if (t[t.find(w)-1]!=' ' or t[t.find(w)+1]!=' ')
			cnt--;
		t.erase(t.find(w), w.size());
	}

	cout << cnt;

	return 0;
}

Compiler output:
a.cc:5:10: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    5 | string t=' ';
      |          ^~~
Language: C++


import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in); 
        int cnt = 0;
        String search = sc.next();
        String word;
        final String END_OF_TEXT = "END_OF_TEXT";
        
        while(sc.hasNextLine()) {
            word = sc.next();
            
            if (word.equals(END_OF_TEXT)) {
                break;
            }
            
            if (word.equals(search)) {
                cnt++;
            }
        }
        
        System.out.println(cnt);
        
    }
}

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

#include <iostream>
#include <cctype>

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

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

        while(true){
                std::cin >> t;
                if(t == "END_OF_TEXT") break;
                transform (t.begin(), t.end(), t.begin(), tolower);
                if(t.find(w) != std::string::npos) count++;
        }

        std::cout << count << std::endl;
}

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

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define rep(i, n) for (int i=0; i<n; ++i)
// W: Word, T: Text
char W[11];
char T[1001];
int main()
{
    int i, j, n;
    n = 0;
    scanf("%s", W);
    while (scanf("%s", T) != EOF) {
        if(stricmp(T, W) == 0) ++n;
    }
    printf("%d\n", n);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'stricmp' was not declared in this scope; did you mean 'strncmp'?
   14 |         if(stricmp(T, W) == 0) ++n;
      |            ^~~~~~~
      |            strncmp
Language: C++

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define rep(i, n) for (int i=0; i<n; ++i)
// W: Word, T: Text
char W[11];
int main()
{
    char T[1001];
    int i, j, n;
    n = 0;
    scanf("%s", W);
    while (scanf("%s", T) != EOF) {
        if(stricmp(T, W) == 0) ++n;
    }
    printf("%d\n", n);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'stricmp' was not declared in this scope; did you mean 'strncmp'?
   14 |         if(stricmp(T, W) == 0) ++n;
      |            ^~~~~~~
      |            strncmp
Language: C++

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

using namespace std;

#define FOR(i,a,b) for(int i=int(a);i<int(b);++i)
#define RFOR(i,a,b) for(int i=int(b)-1;i>=int(a);--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)

int main()
{
    string W, T;
    int cnt, l;
    cin >> W;
    cnt = 0;
    l = W.size();
    REP(i,l) if (isupper(W[i])) W[i] = tolower(W[i]);
    while(cin >> T) {
        if (T == "END_OF_TEXT") break;
        REP(i,l) if (isupper(T[i])) T[i] = tolower(T[i])
        if (W == T) ++cnt;
    }
    cout << cnt << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:57: error: expected ';' before 'if'
   22 |         REP(i,l) if (isupper(T[i])) T[i] = tolower(T[i])
      |                                                         ^
      |                                                         ;
   23 |         if (W == T) ++cnt;
      |         ~~
Language: C++

s=input();ans=0
while 1:
    a = input()
    if a=="END_OF_TEXT":
        print(ans);break
    ans+=a.count(s)


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=input();ans=0
      | ^
a.cc:1:11: error: 'ans' does not name a type
    1 | s=input();ans=0
      |           ^~~
a.cc:5:20: error: expected unqualified-id before 'break'
    5 |         print(ans);break
      |                    ^~~~~
Language: C++

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

int main() {
	string W, T[1000];
	int count = 0;
	int sumwords = 0;
	cin >> W;

	while (true) {
		cin >> T[count];
		if (T[count] == "END_OF_TEXT") {
			break;
		}

		count++;
	}
	for (int i = 0; i < count; i++) {
		//if (T[i].find(W) != string::npos) {
		if(! stricmp(T[i].c_str(),W.c_str())){
			sumwords++;
		}
	}

	cout << sumwords << endl;

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'stricmp' was not declared in this scope
   23 |                 if(! stricmp(T[i].c_str(),W.c_str())){
      |                      ^~~~~~~
Language: C++

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

int main() {
	string W, T[1000];
	int count = 0;
	int sumwords = 0;
	cin >> W;

	while (true) {
		cin >> T[count];
		if (T[count] == "END_OF_TEXT") {
			break;
		}

		count++;
	}
	for (int i = 0; i < count; i++) {
		//if (T[i].find(W) != string::npos) {
		if(0 == stricmp(T[i].c_str(),W.c_str())){
			sumwords++;
		}
	}

	cout << sumwords << endl;

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: 'stricmp' was not declared in this scope; did you mean 'strncmp'?
   24 |                 if(0 == stricmp(T[i].c_str(),W.c_str())){
      |                         ^~~~~~~
      |                         strncmp
Language: C++

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

int main(int argc, char *argv[])
{
    string w;
    string s;
    int count = 0;
    cin >> w;
    transform(w.begin(), w.end(), w.begin(), ::tolower);
    while (cin >> s && s != "END_OF_TEXT")
    {
        transform(s.begin(), s.end(), s.begin(), ::tolower);
        if (s.find(w) != string::npos)
            count++;
    }
    cout << count << endl;

    return 0;
}


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

count = 0
word = gets.chomp
word.downcase!

loop do
    l = readline
    line = l.split
    line.each{|str|
        count += 1 if str.downcase == word
    }
    break if l == "END_OF_TEXT"
end

puts count



Compiler output:
a.cc:1:1: error: 'count' does not name a type
    1 | count = 0
      | ^~~~~
a.cc:11:5: error: expected unqualified-id before 'break'
   11 |     break if l == "END_OF_TEXT"
      |     ^~~~~
Language: C++

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

int main() {
    string w, t;
    int i;

    getline(cin, w);
    i = 0;

    getline(cin, t);

while(t!="END_OF_TEXT")
    if (w.find(t) != string::npos) {
        i++;
    }
}
cout << i << endl;
    return 0;
}



Compiler output:
a.cc:20:1: error: 'cout' does not name a type
   20 | cout << i << endl;
      | ^~~~
a.cc:21:5: error: expected unqualified-id before 'return'
   21 |     return 0;
      |     ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    string w, t;
    int a = 0;
    cin >> w;
    while (cin >> t) {
        if (t == "END_OF_TEXT") break;
        for (int i = 0; i < t.size(); i++) {
            if (isupper(t)) t = tolower(t);
        }
        if (t == w) a++;
    }
    cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: no matching function for call to 'isupper(std::string&)'
   11 |             if (isupper(t)) 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:2631:5: note: candidate: 'template<class _CharT> bool std::isupper(_CharT, const locale&)'
 2631 |     isupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2631: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:117:1: note: candidate: 'int isupper(int)'
  117 | __exctype (isupper);
      | ^~~~~~~~~
/usr/include/ctype.h:117:1: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  117 | __exctype (isupper);
      | ^~~~~~~~~
a.cc:11:40: error: no matching function for call to 'tolower(std::string&)'
   11 |             if (isupper(t)) 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;
      |                     ~~~~^~~
Language: C++

#include<iostream>
#include<string>
 
int main(){
  int count=0;
  std::string W;
  std::cin>>W;
  std::string str;
  while(1){
    std::cin>>str;
    if(str=="END_OF_TEXT")break;
    std::transform(str.begin(),str.end(),str.begin(),tolower);
    if(str==W){
      count++;
    }
  }
  std::cout<<count<<std::endl;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;

char tolower(char ch){
    if( 'A' <=ch && ch <= 'Z' ){
        return ch-'A'+'a';
    }else{
        return ch;
    }
}

int main(){
    int count=0;
    string W;
    cin>>W;
    cin>>W;
    string str;
    while(1){
        cin>>str;
        if(str=="END_OF_TEXT")break;
        for(int i=0;i<(int)str.size();i++){
            str[i]=tolower(str[i]);
        }
        if(str==W){
            cout++;
        }
    }
    cout<<count<<endl;
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;

int main(){
    string w,t;
    int counter = 0;
    
    cin >> w;
    
    while(cin >> t){
        if(t == "END_OF_FILE") break;
        
        if( (int)w.size() == (int)t.size() ){
            for(int i = 0;i<(int)w.size();++i){
                if( isupper(w[i]) ) w[i] = toloser(w[i]);
                if( isupper(t[i]) ) t[i] = tolower(t[i]);
                
                if(w[i] != t[i]) break;
                
                if(i == (int)w.size() - 1){
                    ++counter;
                }
            }
        }
        
        cout << counter << endl;
        
        return 0;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: error: 'toloser' was not declared in this scope; did you mean 'tolower'?
   15 |                 if( isupper(w[i]) ) w[i] = toloser(w[i]);
      |                                            ^~~~~~~
      |                                            tolower
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
string w;
string t;
int al=0;
cin>>w;
while(cin>>t){
for(i=0;i<t.size;i++){
if(isupper(t[i])){t[i]=tolower(t[i]);}
}

if(t==w){
al++;
}}

cout<<al<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<t.size;i++){
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
string w;
string t;
int al=0;
cin>>w;
while(cin>>t){
for(int i=0;i<t.size;i++){
if(isupper(t[i])){t[i]=tolower(t[i]);}
}

if(t==w){
al++;
}}

cout<<al<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: 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 '()' ?)
   10 | for(int i=0;i<t.size;i++){
      |               ~~^~~~
      |                     ()
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 100000000
#define MOD 100000007
#define SIZE 100005
#define pi 	3.14159265358979323846

int main(){
	ll ans = 0;
	string w;
	cin >> w;
	REP(i,w.size()){
			if(65<w[i]&&w[i]<91){
				w[i] += 32;
			}
		}
	while(1){
		string s;
		cin >> s;
		if(s.size()==w.size()){
			REP(i,s.size()){
				if(65<s[i]&&s[i]<91){a
					s[i] += 32;
				}
			}
			if(s=="END_OF_TEXT"){
				cout << ans << endl;
				return 0;
			}
			if(s==w){
				ans++;
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:54: error: 'a' was not declared in this scope
   42 |                                 if(65<s[i]&&s[i]<91){a
      |                                                      ^
Language: C++

/**
 * Grading.cpp
 * Create:20180430
 * Description:文章Tの中に存在する
 * 単語Wの数をカウントするプログラム。
 */
#include <iostream>
#include <vector>
#include <map>

const std::string END_KEYWORD = "END_OF_TEXT";

int boyer_moore(const std::string &line, const std::string &keyword);

int main(int argc, char* argv[]){
  std::string w;
  std::vector<std::string> vec;

  std::getline(std::cin, w);
  // すべて小文字に変更
  std::transform(w.begin(), w.end(), w.begin(), tolower);

  while (true){
    std::string line;
    std::getline(std::cin, line);
    if (line == END_KEYWORD)
      break;
      // すべて小文字に変更
    std::transform(line.begin(), line.end(), line.begin(), tolower);
    vec.push_back(line);
  }

  int sum = 0;

  for(std::string line:vec){
    sum += boyer_moore(line, w);
    //std::cout << boyer_moore(line, w) << std::endl;
  }

  std::cout << sum << std::endl;

  return 0;
}

/**
 * BM法による検出関数
 * @param  line    一行当たりの内容
 * @param  keyword 検索文字列
 * @return         出現回数
 */
int boyer_moore(const std::string &line, const std::string &keyword){
  // 出現回数のカウンタ
  int counter = 0;

  // 文字列に存在しない文字が来た時のステップ数
  int otherStep = keyword.size();

  // 文字列とヒットした場所に対するステップ数の辞書
  std::map<char, int> dictStep;
  for (int i = 0; i < keyword.size(); i++){
    dictStep[keyword[i]] = keyword.size() - 1 - i;
  }

  // Debug:できた辞書の内容を表示
  /*
  for (auto &x: dictStep){
    std::cout << x.first << ":" << x.second << std::endl;
  }
  std::cout << "others:" << otherStep << std::endl;
  */

  // 開始位置をバターン末尾に合わせる
  int i = keyword.size() - 1;
  int p = 0;

  while (i < line.size()){
    // パターン末尾に位置を合わせる
    p = keyword.size() - 1;

    while (p >= 0 && i < line.size()){
      if (line[i] == keyword[p]){
        i--;
        p--;
      } else {
        break;
      }
    }
    // 一致判定
    if (p < 0){
      counter++;
    }

    // 不一致の場合、辞書を参照しiを進める
    // ただし、今比較した位置より後の位置とする
    int stepA;
    auto itr = dictStep.find(keyword[p]);
    if (itr != dictStep.end()){
      stepA = itr->second;
    } else {
      stepA = otherStep;
    }
    int stepB = keyword.size() - p;

    if (stepA > stepB){
      i += stepA;
    } else {
      i += stepB;
    }
  }

  return counter;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:21:8: error: 'transform' is not a member of 'std'
   21 |   std::transform(w.begin(), w.end(), w.begin(), tolower);
      |        ^~~~~~~~~
a.cc:29:10: error: 'transform' is not a member of 'std'
   29 |     std::transform(line.begin(), line.end(), line.begin(), tolower);
      |          ^~~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
          int c=0,i;
          char W[11],T[1001],*p;
          gets(W);
          for(i=0;W[i];i++)W[i]=tolower(W[i]);
          for(;gets(T),strcmp(T,"END_OF_FILE");)
          {

          for(i=0;T[i];i++)T[i]=tolower(T[i]);
          p=strtok(T," ");
          while(p!=NULL)
          {
                    if(!strcmp(W,p))
                              c++;
                    p=strtok(NULL," ");
          }

          }
           printf("%d\n",c);

}



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

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string W,T;
	int cnt=0;
	cin>>W;
	while(1){
		cin>>T;
		if(T=="END_OF_TEXT") break;
		transform(T.begin(),T.end(),T.begin(),tolower);
		if(W==T) cnt++;
	}

	cout<<cnt<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   12 |                 transform(T.begin(),T.end(),T.begin(),tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
 4209 |     transform(_InputIterator __first, _InputIterator __last,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note:   template argument deduction/substitution failed:
a.cc:12:26: note:   couldn't deduce template parameter '_UnaryOperation'
   12 |                 transform(T.begin(),T.end(),T.begin(),tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
 4247 |     transform(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note:   candidate expects 5 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
  156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note:   candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
  162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note:   candidate expects 6 arguments, 4 provided
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string W,T;
	int cnt=0,i=0;
	cin>>W;
	while(1){
		i++;
		cin>>T;
		if(T=="END_OF_TEXT") break;
		transform(T.begin(),T.end(),T.begin(),tolower);
		if(W==T) cnt++;
	}

	cout<<cnt<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   13 |                 transform(T.begin(),T.end(),T.begin(),tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
 4209 |     transform(_InputIterator __first, _InputIterator __last,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note:   template argument deduction/substitution failed:
a.cc:13:26: note:   couldn't deduce template parameter '_UnaryOperation'
   13 |                 transform(T.begin(),T.end(),T.begin(),tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
 4247 |     transform(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note:   candidate expects 5 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
  156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note:   candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
  162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note:   candidate expects 6 arguments, 4 provided
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int i=0,j=0;
    string a;
    string s,f;
    cin>>a;
    while(cin>>s){
        f+=s;
    }
    while(1){
        if(f.find(a,i)==-1){
            break;
        }else if(f.find(a,i)>=0){
            j++;
            i+=f.find(a,i);
        }
    }
    cout<<f-1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   21 |     cout<<f-1<<endl;
      |           ~^~
      |           | |
      |           | int
      |           std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:21:13: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   21 |     cout<<f-1<<endl;
      |             ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:21:13: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   21 |     cout<<f-1<<endl;
      |             ^