#include<stdio.h> #include<math.h> #include<string.h> //#include<algorithm> #include <bits/stdc++.h> using namespace std; int main() { string str,str2; while(cin>>str) { cin>>str2; int temp=str.find(str2); if(temp==-1) { printf("-1\n"); } else { printf("%d\n",temp+1); } } } |
Double click to view unformatted code.