Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<map>
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- map<string,vector<string>> const cuptoare {
- { "P0001M", { "[microwave]" } },
- { "P0001MG", { "[microwave]","[grill]" } },
- { "P0002M", { "[microwave]" ,"[grill]","[ventilator]"} },
- { "P0003", { "[microwave]" ,"[grill]","[ventilator]","[steam]"} },
- { "P0004", { "[grill]" ,"[crisp]","[rotisserie]"} },
- { "P0004M", { "[microwave]","[grill]" ,"[crisp]","[rotisserie]" } },
- { "P0003X", { "[microwave]" ,"[grill]","[ventilator]","[steam]","[convection]","[ventilator]"}},
- { "P00034X", { "[microwave]" ,"[grill]","[ventilator]","[steam]","[crisp]","[rotisserie]","[convection]"}}
- };
- string cuptornou;
- int n;
- int k;
- int cont=0;
- string cuvinte,cuv;
- cout << "spune-mi nume si nr" << endl;
- cin>>cuptornou>>n;
- for(int i=0;i<n;i++)
- {
- scanf("%d\n", &k);
- for(int j=0;j<k;j++)
- {
- getline(cin, cuvinte);
- cout<<cuvinte << endl;
- for (auto it = cuptoare.begin(); it != cuptoare.end(); it++)
- {
- if(it->first==cuptornou)
- {
- for(vector<string>::const_iterator t=it->second.begin(); t!=it->second.end(); t++)
- {
- stringstream X(cuvinte);
- while (getline(X, cuv, ' '))
- {
- //if(strcmp(*t, cuv) == 0)
- //{
- //cont++;
- //}
- cout<<"Aici: " << cuv << endl;
- }
- }
- }
- }
- }
- }
- cout<<cont << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement