View Code of Problem 3832

#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.


Back to problem 3832