You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
int pos;
|
|
|
|
|
int cnt;
|
|
|
|
|
string a, B;
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
cin >> a;
|
|
|
|
|
for (int i = 0; i < a.size(); i++)
|
|
|
|
|
if (a[i] >= 'A' && a[i] <= 'Z') a[i] += 32;
|
|
|
|
|
a = ' ' + a + ' ';
|
|
|
|
|
//读入一行数据之前,如果有输入,要getchar();
|
|
|
|
|
getchar();
|
|
|
|
|
getline(cin, b);
|
|
|
|
|
b = ' ' + b + ' ';
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < b.size(); i++)
|
|
|
|
|
if (b[i] >= 'A' && b[i] <= 'Z') b[i] += 32;
|
|
|
|
|
|
|
|
|
|
//在b中查找a
|
|
|
|
|
int p = 0;
|
|
|
|
|
while ((p = b.find(a, p)) != b.npos) {
|
|
|
|
|
cnt++;
|
|
|
|
|
if (cnt == 1) pos = p;
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
if (cnt > 0) printf("%d %d\n", cnt, pos);
|
|
|
|
|
else printf("%d", -1);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|