#include<iostream> using namespace std; int main(){ string s; while(getline(cin, s)){ if(s=="</xmp>") break; if(s.find("h3")!=-1){ int start=s.find(">")+1; int tail=s.find("</h3>"); string name=s.substr(start, tail-start); string info; for(int i=0; i<4; i++){ getline(cin, info); int st=info.find("customer_commit_display"); if(st!=-1){ st+=25; int ta=info.find("</span>"); string cdt=info.substr(st, ta-st); if(cdt=="In Stock") cout<<name<<endl; } } } } return 0; } |
Double click to view unformatted code.