View Code of Problem 3832

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a,b;
	while(cin>>a)
	{
		cin>>b;
		int ans=a.find(b);
		if(ans!=-1)
		{
			cout<<ans+1<<endl;
		}
		else cout<<ans<<endl;	
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3832