#include <stdio.h>
#include<string.h>
#include<ctype.h>
int main() {
char S[100] = { 0 };
char str[100] = "Bob";
int len = strlen(str);
int count = 0;
scanf("%s", S);
int pos = 0;
while (S[pos] != '\0') {
if (tolower(S[pos]) == tolower(str[0])) {
count = 1;
int temp = pos + 1;
for (int i = 1; i < len; i++) {
if (S[temp] != '\0' && tolower(S[temp]) == tolower(str[i])) {
count++;
}
temp++;
}
if (count == len) {
printf("%d\n", pos);
return 0;
}
}
pos++;
}
printf("-1\n");
return 0;
}

京公网安备 11010502036488号