#include <bits/stdc++.h> using namespace std; string str1,str2; int main() { while(cin>>str1>>str2) { int pos = str1.find(str2); if(pos!=-1) { cout<<pos+1<<endl; } else { cout<<pos<<endl; } } return 0; } |
Double click to view unformatted code.