Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <conio.h>
- using namespace std;
- int main() {
- const size_t size = 12;
- char square[size], symbol;
- for (size_t i = 0; i < size; ++i) {
- if (0 == (i + 1) % 4) square[i] = '\n';
- else {
- symbol = _getch();
- square[i] = symbol;
- }
- cout << square[i];
- }
- COORD coord;
- coord.X = 8;
- coord.Y = 0;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
- _getch();
- for (size_t i = 0; i < size; ++i) {
- if (0 == (i + 1) % 4){
- coord.X = 8;
- ++coord.Y;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
- }
- else cout << square[i];
- }
- coord.X = 0;
- coord.Y = 8;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
- _getch();
- for (size_t i = 0; i < size; ++i) cout << square[i];
- cin.sync();
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement