ThaiPeen

wrong timus 1893

May 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<cstdlib>
  4. #include<cstring>
  5. using namespace std;
  6. int main() {
  7.     int k[2];
  8.     string a;
  9.     cin >> a;
  10.     if (a.length() == 2) {
  11.         for (int i = 0; i < 2; i++) {
  12.             k[i] = a[i] - '0';
  13.         }
  14.         int u = k[0] * 10 + k[1];
  15.         if (u < 21) {
  16.             if (a[2] == 'A' || a[1] == 'F')
  17.                 cout << "window";
  18.             else cout << "aisle";
  19.         }
  20.         else {
  21.             if (a[2] == 'A' || a[2] == 'K')
  22.                 cout << "window";
  23.             else if (a[2] == 'C' || a[2] == 'D' || a[2] == 'G' || a[2] == 'H')
  24.                 cout << "aisle";
  25.             else cout << "neither";
  26.         }
  27.     }
  28.    
  29.     else {
  30.         k[0] = a[0] - '0';
  31.         if (k[0] < 3) {
  32.             if (a[1] == 'A' || a[1] == 'D')
  33.                 cout << "window";
  34.             else cout << "aisle";
  35.         }
  36.         else {
  37.             if (a[1] == 'A' || a[1] == 'F')
  38.                 cout << "window";
  39.             else cout << "aisle";
  40.         }
  41.     }
  42.     system("pause");
  43. }
Advertisement
Add Comment
Please, Sign In to add comment