From 5a71cac9da76c40201c7d97ab821a8d96fa193d9 Mon Sep 17 00:00:00 2001 From: oltnd Date: Sat, 9 Nov 2024 15:14:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20flag=5Ffor=5Femin.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flag_for_emin.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 flag_for_emin.cpp diff --git a/flag_for_emin.cpp b/flag_for_emin.cpp new file mode 100644 index 0000000..17c6e72 --- /dev/null +++ b/flag_for_emin.cpp @@ -0,0 +1,25 @@ +void z4() { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + + const int width = 20; // Ширина флага + const int height = 10; // Высота флага + const int centerX = width / 2; + const int centerY = height / 2; + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + // Определяем, находится ли точка (x, y) внутри круга + int dx = x - centerX; + int dy = y - centerY; + if (dx * dx + dy * dy <= circleRadius * circleRadius) { + + } + else { + SetConsoleTextAttribute(hConsole, 0xf0); // Белый цвет + } + cout << " "; // Два пробела для более широкого изображения + } + cout << endl; + } + SetConsoleTextAttribute(hConsole, 15); // Сбрасываем цвет на белый +} \ No newline at end of file