SHARE
TWEET

Guzu

a guest Nov 22nd, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<vector>
  3. #include<map>
  4. #include <bits/stdc++.h>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     map<string,vector<string>> const cuptoare {
  12.     { "P0001M", { "[microwave]" } },
  13.     { "P0001MG", { "[microwave]","[grill]" } },
  14.     { "P0002M", { "[microwave]" ,"[grill]","[ventilator]"} },
  15.     { "P0003", { "[microwave]" ,"[grill]","[ventilator]","[steam]"} },
  16.     { "P0004", { "[grill]" ,"[crisp]","[rotisserie]"} },
  17.     { "P0004M", { "[microwave]","[grill]" ,"[crisp]","[rotisserie]" } },
  18.     { "P0003X", { "[microwave]" ,"[grill]","[ventilator]","[steam]","[convection]","[ventilator]"}},
  19.     { "P00034X", { "[microwave]" ,"[grill]","[ventilator]","[steam]","[crisp]","[rotisserie]","[convection]"}}
  20.     };
  21.     string cuptornou;
  22.     int n;
  23.     int k;
  24.     int cont=0;
  25.     string cuvinte,cuv;
  26.     cout << "spune-mi nume si nr" << endl;
  27.     cin>>cuptornou>>n;
  28.     for(int i=0;i<n;i++)
  29.     {
  30.         scanf("%d\n", &k);
  31.         for(int j=0;j<k;j++)
  32.         {
  33.             getline(cin, cuvinte);
  34.             cout<<cuvinte << endl;
  35.             for (auto it = cuptoare.begin(); it != cuptoare.end(); it++)
  36.             {
  37.                  if(it->first==cuptornou)
  38.                  {
  39.                     for(vector<string>::const_iterator t=it->second.begin(); t!=it->second.end(); t++)
  40.                      {
  41.                         stringstream X(cuvinte);
  42.                         while (getline(X, cuv, ' '))
  43.                          {
  44.                             //if(strcmp(*t, cuv) == 0)
  45.                             //{
  46.                                 //cont++;
  47.                             //}
  48.                             cout<<"Aici: " << cuv << endl;
  49.                          }
  50.                      }
  51.                  }
  52.             }
  53.         }
  54.     }
  55.     cout<<cont << endl;
  56.     return 0;
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top