利用ellipse and rectangle 画图。用visual studio画图,下载EasyX图形库。
#include <graphics.h> // 引用图形库头文件
#include <conio.h>
int main()
{
initgraph(640, 480); // 创建绘图窗口,大小为 640x480 像素
ellipse(20, 20, 120, 50);
ellipse(170, 20, 270, 50);
rectangle(130, 70, 150, 150);
rectangle(70, 170, 200, 250);
_getch(); // 按任意键继续
closegraph(); // 关闭绘图窗口
return 0;
}