Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. const int MAXN = 100000 + 100;
  5. const int N = 8;
  6.  
  7. int main(){
  8.     int mas[N][N];
  9.    
  10.     for (int i = 0; i < N; ++i){
  11.         mas[0][i] = ((i + 1) % 2);
  12.     }
  13.    
  14.     for (int i = 1; i < N; ++i){
  15.         for (int j = 0; j < N; ++j){
  16.             if (mas[i - 1][j] == 0){
  17.                 mas[i][j] = 1;
  18.             } else {
  19.                 mas[i][j] = 0;
  20.             }
  21.         }
  22.     }
  23.    
  24.     int i, j;
  25.    
  26.     char c;
  27.    
  28.     cin >> c;
  29.     i = c - 'A';
  30.    
  31.     cin >> c;
  32.     j = c - '1';
  33.    
  34.     if (mas[i][j] == 1){
  35.         cout << "BLACK" << endl;
  36.     } else {
  37.         cout << "WHITE" << endl;
  38.     }
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement