#include <iostream>
#include <iterator>
using namespace std;
int main() {
string s;
cin >> s;
for(char &c :s){
if(c>='A' && c<='Z'){
c+=32;
}
}
size_t pos = s.find("bob");
if(pos!=string::npos){
cout << pos <<endl;
}else{
cout << -1 <<endl;
}
}
string的find函数

京公网安备 11010502036488号