T3000

Untitled

Apr 2nd, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. int main()
  7. {
  8.     ll n;
  9.     cin >> n;
  10.     string a;
  11.     char hl;
  12.     while (n-- > 0)
  13.     {
  14.         vector<ll> z1(26);
  15.  
  16.         getline(cin >> ws, a);
  17.         for (int i = 0; i < a.length(); i++)
  18.         {
  19.             hl = tolower(a.at(i));
  20.             if (hl >= 'a' && hl <= 'z')
  21.             {
  22.                 z1.at(hl - 97) += 1;
  23.             }
  24.         }
  25.         int x = count(z1.begin(), z1.end(), 0);
  26.         if (x == 0)
  27.         {
  28.             cout << "pangram" << endl;
  29.         }
  30.         else
  31.         {
  32.             cout << "missing ";
  33.             for (int j = 0; j < 26; j++)
  34.             {
  35.                 if (z1.at(j) == 0)
  36.                 {
  37.                     cout << char(j + 97);
  38.                 }
  39.             }
  40.             cout << endl;
  41.         }
  42.     }
  43.     return 0;
  44.  
Advertisement
Add Comment
Please, Sign In to add comment