Language: C++

#include<bits/stdc++.h>
using namespace std;
string S[999],a,i;
int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
int main(){
	cin>>n>>m;
	for(i=0;i<n;i++){
		cin>>S[i]>>over[i];
	}
	for(i=0;i<n;i++){
		pass=0;
		while(pass!=S[i].size()){
			cout<<"? "<<S[i]<<endl;
			cin>>a;
			totalcnt++;
			if(tolower(a[0])==tolower(S[i][pass])){ 
				S[i][pass]='_';pass++;misscnt++; 
			}
			else{
				miss[i]++;
				if(miss[i]>over[i]){
					m--;break;
				}
			}
		}
		if(m<=0){ 
			cout<<"! Game Over"<<endl;return 0; 
		}
	}
	cout<<setprecision(1)<<"! Game Clear "<<(double)((int)(1000*misscnt/totalcnt)/10.0)<<endl;
}

Compiler output:
a.cc:4:30: error: expected unqualified-id before ',' token
    4 | int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
      |                              ^
a.cc:4:38: error: expected constructor, destructor, or type conversion before ',' token
    4 | int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
      |                                      ^
a.cc:4:47: error: expected constructor, destructor, or type conversion before ',' token
    4 | int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
      |                                               ^
a.cc:4:49: error: expected constructor, destructor, or type conversion before ',' token
    4 | int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
      |                                                 ^
a.cc:4:51: error: expected constructor, destructor, or type conversion before ';' token
    4 | int pass,miss[999],over[999];,misscnt,totalcnt,n,m;
      |                                                   ^
a.cc: In function 'int main()':
a.cc:6:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin>>n>>m;
      |              ^
      |              yn
a.cc:6:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |         cin>>n>>m;
      |                 ^
      |                 tm
a.cc:7:15: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
    7 |         for(i=0;i<n;i++){
      |               ^
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
a.cc:7:22: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    7 |         for(i=0;i<n;i++){
      |                     ~^~
a.cc:8:23: error: no match for 'operator[]' (operand types are 'std::string [999]' {aka 'std::__cxx11::basic_string<char> [999]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    8 |                 cin>>S[i]>>over[i];
      |                       ^
a.cc:8:32: error: no match for 'operator[]' (operand types are 'int [999]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    8 |                 cin>>S[i]>>over[i];
      |                                ^
a.cc:10:15: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   10 |         for(i=0;i<n;i++){
      |               ^
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
a.cc:10:22: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 |         for(i=0;i<n;i++){
      |                     ~^~
a.cc:12:30: error: no match for 'operator[]' (operand types are 'std::string [999]' {aka 'std::__cxx11::basic_string<char> [999]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   12 |                 while(pass!=S[i].size()){
      |                              ^
a.cc:13:38: error: no match for 'operator[]' (operand types are 'std::string [999]' {aka 'std::__cxx11::basic_string<char> [999]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   13 |                         cout<<"? "<<S[i]<<endl;
      |                                      ^
a.cc:15:25: error: 'totalcnt' was not declared in this scope
   15 |                         totalcnt++;
      |                         ^~~~~~~~
a.cc:16:52: error: no match for 'operator[]' (operand types are 'std::string [999]' {aka 'std::__cxx11::basic_string<char> [999]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   16 |                         if(tolower(a[0])==tolower(S[i][pass])){
      |                                                    ^
a.cc:17:34: error: no match for 'operator[]' (operand types are 'std::string [999]' {aka 'std::__cxx11::basic_string<char> [999]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   17 |                                 S[i][pass]='_';pass++;misscnt++;
      |                                  ^
a.cc:17:55: error: 'misscnt' was not declared in this scope; did you mean 'miss'?
   17 |                                 S[i][pass]='_';pass++;misscnt++;
      |                                                       ^~~~~~~
      |                                                       miss
a.cc:20:37: error: no match for 'operator[]' (operand types are 'int [999]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   20 |                                 miss[i]++;
      |                                     ^
a.cc:21:40: error: no match for 'operator[]' (operand types are 'int [999]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   21 |                                 if(miss[i]>over[i]){
      |                                        ^
a.cc:21:48: error: no match for 'operator[]' (operand types are 'int [999]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   21 |                                 if(miss[i]>over[i]){
      |                                                ^
a.cc:30:69: error: 'misscnt' was not declared in this scope; did you mean 'miss'?
   30 |         cout<<setprecision(1)<<"! Game Clear "<<(double)((int)(1000*misscnt/totalcnt)/10.0)<<endl;
      |                                                                     ^~~~~~~
      |                                                                     miss
a.cc:30:77: error: 'totalcnt' was not declared in this scope
   30 |         cout<<setprecision(1)<<"! Game Clear "<<(double)((int)(1000*misscnt/totalcnt)/10.0)<<endl;
      |                                                                             ^~~~~~~~