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