#include<graphics.h>
#include<stdio.h>
#include<math.h>
#include<conio.h>
#define P 3.14
void main()
{
double i;
int x0,y0,r,rs;
int gdriver=9,gmode=2;
initgraph(&gdriver,&gmode,"");
cleardevice();
setbkcolor(15);
setcolor(5);
outtextxy(80,20,"The programm show the circles picture.");//功 能: 在指定位置顯示一字串
setcolor(4);
outtextxy(160,60,"r<rs");
r=50;rs=70;
for(i=0;i<=2*P;i+=P/18)
{
x0=200+r*cos(i);
y0=200+r*sin(i);
circle(x0,y0,rs);
}
setcolor(3);
outtextxy(360,60,"r=rs");
r=50;rs=50;
for(i=0;i<=2*P;i+=P/18)
{
x0=380+r*cos(i);
y0=200+r*sin(i);
circle(x0,y0,rs);
}
setcolor(6);
outtextxy(480,60,"r>rs");
r=50;rs=35;
for(i=0;i<=2*P;i+=P/18)
{
x0=500+r*cos(i);
y0=200+r*sin(i);
circle(x0,y0,rs);
}
setcolor(5);
outtextxy(80,460,"press any key to quit...");
getch();
closegraph();
}
uj5u.com熱心網友回復:
什么編譯環境?轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/67652.html
標籤:基礎類
上一篇:關于源代碼格式的問題:如何把代碼片中美觀的格式加入到寫出來的博客中?
下一篇:不同檔案的內容輸入到類物件陣列中
