JosepRivaille

P77715: Pangrames

Jun 2nd, 2015
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7.     char c;
  8.     while (cin >> c) {
  9.         if(c != '.') {
  10.             vector<bool> v(26, false);
  11.             if (c >= 'A' && c <= 'Z') v[int(c - 'A')] = true;
  12.             else if (c >= 'a' && c <= 'z') v[int(c - 'a')] = true;
  13.             while (cin >> c && c != '.') {
  14.                 if (c >= 'A' && c <= 'Z') v[int(c - 'A')] = true;
  15.                 else if (c >= 'a' && c <= 'z') v[int(c - 'a')] = true;
  16.             }
  17.             bool error = false;
  18.             for (int i = 0; i < 26 && not error; ++i) {
  19.                 if (not v[i]) error = true;
  20.             }
  21.             if (not error) cout << "SI" << endl;
  22.             else cout << "NO" << endl;
  23.         }
  24.         else cout << "NO" << endl;
  25.     }
  26. }
  27.  
  28. //JosepRivaille
Advertisement
Add Comment
Please, Sign In to add comment