#include<graphics.h>
main()
{
int gm,gd=DETECT
int a,T,X,R=100
scanf("%d",&a)
T=200,
X=a*T
initgraph(&gd,&gm,"")/*双引号戚悔卜内填bgi文件夹在你电脑中的目录,如在c:\tc\bgi,且c文件在高穗c:\tc\programfiles下,则填"..\\bgi"*/
circle(X,T,R)/前尺*R为半径*/
getch();
closegraph()
}
换账号再来回答,veket的小号。。。
.......用了ege图形库.........纯体力活.........
源代码....demo.cpp.....
/////////////////////////////////////////
// ege 0.3.8
// MinGW g++ 3.4.2
// veket的小号
/////////////////////////////////////////
#include "graphics.h"
#include <stdio.h>
const int YLEN = 50
const int XLEN = 40
const int WIDTH = 10*XLEN
const int HEIGHT = 2*YLEN
const int 桐或XWIDTH = 640
const int YHEIGHT = 480
int main()
{
int x1, y1, x2, y2, x, y
char strbuf[100]
int i
setinitmode(0)
initgraph(XWIDTH, YHEIGHT)
setbkcolor(RGB(0xcc, 0xcc, 0xcc))
setfillstyle(RGB(0xff, 0xff, 0xff))
x2 = x1 = (getmaxx()-WIDTH)/2
y1 = (getmaxy()-2*HEIGHT-YLEN)/2
y2 = y1 + HEIGHT + YLEN
bar(x1, y1, x1+WIDTH, y1+2*YLEN)
setcolor(RGB(0x04, 0x04, 0x04))
rectangle(x1, y1, x1+WIDTH, y1+2*YLEN)
outtextxy(x1-20, y1-10, "1")
outtextxy(x1-20, y1-10+YLEN, "0")
outtextxy(x1-20, y1-10+2*YLEN, "-1")
for(x=x1,y=y1+2*YLEN+10,i=0x<=x1+WIDTHx+=2*XLEN,i+=2)
{
sprintf(strbuf, "%d\0", i)
outtextxy(x, y, strbuf)
}
for(x=x1x<x1+(int)(3*PI*XLEN)x++)
{
y = y1 + YLEN - (int)(YLEN*sin(1.0*(x-x1)/XLEN) + 0.5)
putpixel(x, y, RGB(0x3e, 0x3e, 0xff))
}
局梁伍渣尺
bar(x2, y2, x2+WIDTH, y2+2*YLEN)
rectangle(x2, y2, x2+WIDTH, y2+2*YLEN)
outtextxy(x2-20, y2-10, "1")
outtextxy(x2-20, y2-10+YLEN, "0.5")
outtextxy(x2-20, y2-10+2*YLEN, "0")
for(x=x2,y=y2+2*YLEN+10,i=0x<=x1+WIDTHx+=2*XLEN,i+=2)
{
sprintf(strbuf, "%d\0", i)
outtextxy(x, y, strbuf)
}
for(x=x2x<x2+(int)(PI*XLEN)x++)
{
y = y2 + 2*YLEN - (int)(2*YLEN*sin(1.0*(x-x1)/XLEN) + 0.5)
putpixel(x, y, RGB(0x3e, 0x3e, 0xff))
}
for(x=x2+(int)(2*PI*XLEN)x<x2+(int)(3*PI*XLEN)x++)
{
y = y2 + 2*YLEN - (int)(2*YLEN*sin(1.0*(x-x1)/XLEN) + 0.5)
putpixel(x, y, RGB(0x3e, 0x3e, 0xff))
}
getch()
closegraph()
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)