View Code of Problem 98

#include<bits/stdc++.h>
using namespace std;

int main() {

	string s;
	vector<string> v;
	while(getline(cin,s)){
		if(s=="</xmp>")
			break;
		if(s.find("h3")!=-1){
			string name;
			int k=s.find('>');
			for(int i=k+1;s[i]!='<';i++){
				name+=s[i];
			}
			string li;
			int n=4;
			while(n--){
				getline(cin,li);
				if(li.find("In Stock")!=-1){
					v.push_back(name);
				}
			}
		} 
	}
	for(int i=0;i<v.size();i++){
		cout<<v[i]<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 98