Добавить flag_for_emin.cpp
This commit is contained in:
25
flag_for_emin.cpp
Normal file
25
flag_for_emin.cpp
Normal file
@@ -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); // Сбрасываем цвет на белый
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user