#include <graphics.h>
#include <conio.h>
void main()
{
initgraph(640, 480);
setbkcolor(WHITE);
cleardevice();
setlinecolor(BLACK);
setfillcolor(MAGENTA);
//填色 画格子
for (int y = 60; y < 480; y += 120)
for (int x = 0; x < 560;x+=160)
fillrectangle(x, y , x+80,y+60);
for (int y = 0; y < 420; y += 120)
for (int x = 80; x < 640;x+=160)
fillrectangle(x, y, x + 80, y + 60);
_getch();
closegraph();
}
#include <conio.h>
void main()
{
initgraph(640, 480);
setbkcolor(WHITE);
cleardevice();
setlinecolor(BLACK);
setfillcolor(MAGENTA);
//填色 画格子
for (int y = 60; y < 480; y += 120)
for (int x = 0; x < 560;x+=160)
fillrectangle(x, y , x+80,y+60);
for (int y = 0; y < 420; y += 120)
for (int x = 80; x < 640;x+=160)
fillrectangle(x, y, x + 80, y + 60);
_getch();
closegraph();
}