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