#include<bits/stdc++.h> using namespace std; int main() { string s1,s2; while(cin>>s1&&cin>>s2){ int temp=s1.find(s2); if(temp!=-1) cout<<temp+1<<endl; else cout<<-1<<endl; } }
Double click to view unformatted code.