View Code of Problem 3832

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    string str1,str2;
    while(cin>>str1>>str2){
        int ans=str1.find(str2);
        if(ans>=0)
            cout<<ans+1<<endl;
        else
            cout<<ans<<endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3832