from standard input , there are many text and patterns . Code : string t,p1,p2; while(getline(cin, t)) { cin>>p1; cin>>p2; cout
stackoverflow.com