foo.cc: In function 'int countChar(std::string)':
foo.cc:17:15: error: 'b' was not declared in this scope
17 | while(rk<n&&b(s1,s[rk])==0)
| ^
foo.cc:6:7: warning: unused variable 't' [-Wunused-variable]
6 | int t,i,n,len,rk;
| ^
foo.cc:27:2: warning: no return statement in function returning non-void [-Wreturn-type]
27 | }
| ^
foo.cc: At global scope:
foo.cc:29:5: error: expected initializer before 'int'
29 | int i,left,right,n;
| ^~~
foo.cc:30:5: error: 'n' does not name a type; did you mean 'yn'?
30 | n=s.length();
| ^
| yn
foo.cc:31:5: error: expected unqualified-id before 'if'
31 | if(k<2)
| ^~
foo.cc:35:8: error: expected unqualified-id before 'if'
35 | if(n<k)
| ^~
foo.cc:40:5: error: expected unqualified-id before 'for'
40 | for(i=0;i<n;i++)
| ^~~
foo.cc:40:13: error: 'i' does not name a type
40 | for(i=0;i<n;i++)
| ^
foo.cc:40:17: error: 'i' does not name a type
40 | for(i=0;i<n;i++)
| ^
foo.cc:44:5: error: 'i' does not name a type
44 | i=0;
| ^
foo.cc:45:5: error: expected unqualified-id before 'while'
45 | while(i<n&&ch[s[i]-'a']>=k)
| ^~~~~
foo.cc:49:5: error: expected unqualified-id before 'if'
49 | if(i==n)
| ^~
foo.cc:53:5: error: 'left' does not name a type
53 | left=countChar(s.substr(0,i),k);
| ^~~~
foo.cc:54:5: error: expected unqualified-id before 'while'
54 | while(i<n&&ch[s[i]-'a']<k)
| ^~~~~
foo.cc:58:6: error: 'right' does not name a type
58 | right=countChar(s.substr(i),k);
| ^~~~~
foo.cc:59:2: error: expected unqualified-id before 'return'
59 | return max(left,right)
| ^~~~~~
[Hydro](https://hydro.ac)提供评测服务