Advertisement
Guest User

c++

a guest
Mar 18th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int linha = 1;
  9.     int coluna = 1;
  10.     COORD coord;
  11.     int linhaX;
  12.  
  13.     while (linha <= 19)
  14.     {
  15.  
  16.      while (coluna <= 19)
  17.         {
  18.             cout << " x ";
  19.             coluna++;
  20.         }
  21.         linha++;
  22.         cout << endl;
  23.         coluna = 1;
  24.     }
  25.  
  26.     linhaX = 1;
  27.     coord.X = 3 * linhaX;
  28.     coord.Y = 10;
  29.  
  30.     SetConsoleCursorPosition(
  31.     GetStdHandle( STD_OUTPUT_HANDLE ),
  32.     coord);
  33.  
  34.     cout << " O ";
  35.  
  36.  
  37.     coord.X = 0;
  38.     coord.Y = 19;
  39.  
  40.     SetConsoleCursorPosition(
  41.     GetStdHandle( STD_OUTPUT_HANDLE ),
  42.     coord);
  43.  
  44.  
  45.  
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement