View Code of Problem 98

#include<iostream>
#include<string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <cmath>
#include<cstring>
using namespace std;
int main()
{
	string s;
	string name;
	while (getline(cin, s))
	{
		
		if (s == "</xmp>")
			break;
		if (s[1] == 'h')
		{
			int pos = s.find_first_of(">") + 1;
			int pos1 = s.find_last_of("<");
			name = s.substr(pos, pos1 - pos);
			//cout << name << endl;
		}
		else
		{
			if (s.find("In Stock") != -1)
			{
				cout << name << endl;
			}
		}
		
			
	}

	
}

Double click to view unformatted code.


Back to problem 98