View Code of Problem 3832

    #include<iostream>
    using namespace std;
    int main() {
    	string str;
		string str1;
		while(cin>>str){
			cin>>str1;
			if(str.find(str1)!=string::npos){
				cout<<str.find(str1)+1<<endl;
			}else{
				cout<<-1<<endl;
			}
		} 
	
    	return 0;
    }

Double click to view unformatted code.


Back to problem 3832