MrS4g0

Untitled

Nov 10th, 2021 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. /*
  2.     author: MrS4g0
  3.     created: 10.11.2021 12:47:29
  4. */
  5.  
  6. #include <bits/stdc++.h>
  7. using namespace std;
  8.  
  9. int main() {
  10.     set<char> vowels = { 'A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o','u' };
  11.  
  12.     int n;
  13.     cin >> n;
  14.  
  15.     vector<string> str_in(n);
  16.     for (auto& it : str_in) {
  17.         cin >> it;
  18.     }
  19.  
  20.     cout << "\nWords without vowels:\n";
  21.     for (auto& it : str_in) {
  22.         set<char> tmp(it.begin(), it.end());
  23.         set<char> intersect;
  24.  
  25.         set_intersection(tmp.begin(), tmp.end(),
  26.                          vowels.begin(), vowels.end(),
  27.                          inserter(intersect, intersect.begin()));
  28.  
  29.         if (intersect.empty()) {
  30.             cout << it << '\n';
  31.         }
  32.     }
  33.  
  34.     return 0;
  35. }
  36.  
  37.  
Add Comment
Please, Sign In to add comment