ortem_kats

salibek_lab4

Feb 4th, 2020
287
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
  5. C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
  6. Code, Compile, Run and Debug online from anywhere in world.
  7.  
  8. *******************************************************************************/
  9. #include <iostream>
  10. #include <string>
  11. #include <vector>
  12.  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17.     string str = "qweeaasdzxc";
  18.     vector<string> vec {"qwee", "dfg", "ss", "zxc", "eaa"};
  19.    
  20.     int kol = 0;
  21.     string vowels = "eyuioa";
  22.     for (auto &s : vec){
  23.         char pc = '.';
  24.         for (auto &cc : s){
  25.             if (cc == pc && vowels.find(cc) != string::npos){
  26.                 kol++;
  27.                 break;
  28.             }
  29.             pc = cc;
  30.         }
  31.     }
  32.    
  33.     cout << 100 * kol / vec.size() << "%\n";
  34.    
  35.     string sentence;
  36.     int count = 0;
  37.     for (auto &s : vec)
  38.         if (str.find(s) != string::npos){
  39.             count++;
  40.             for (int i = 0; i < count; i++)
  41.                 sentence.append("*");
  42.             sentence.append(s + " ");
  43.         }
  44.        
  45.     cout << sentence << "\n";
  46.  
  47.     return 0;
  48. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×