View Code of Problem 3832

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
    string str1, str2;
    while(cin >> str1){
        cin >> str2;
        auto pos = str1.find(str2);
        if(pos == string :: npos)
        cout << -1 << endl;
        else
        cout << pos + 1 << endl;
    }
}

Double click to view unformatted code.


Back to problem 3832