Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     setlocale(LC_ALL, "rus");
  9.     char a[8][8] = { 0 };
  10.     for (int i = 0; i < 8; i++)
  11.         for (int j = 0; j < 8; j++)
  12.             a[i][j] = '*';
  13.     a[6][4] = 'p';
  14.     char b[4] = { 0 };
  15.     for (int i = 0; i < 8; i++)
  16.     {
  17.         cout << endl;
  18.         for (int j = 0; j < 8; j++) cout << a[i][j];
  19.     }
  20.     cout << endl << endl;
  21.     while (cin >> b)
  22.     {
  23.         a[56 - b[4]][b[3] - 97] = a[56 - b[1]][b[0] - 97];
  24.         a[56 - b[1]][b[0] - 97] = '*';
  25.         for (int i = 0; i < 8; i++)
  26.         {
  27.             cout << endl;
  28.             for (int j = 0; j < 8; j++) cout << a[i][j];
  29.         }
  30.         cout << endl << endl;
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement