#include void hDrawk(char c[]);//画水平坐标轴
void vDrawk(char c[]);//画垂直坐标轴
void Drawfline(int b[]);//画折线
int xs=48,ys=50;
void hDraek(char c[]){
int i,j=65;
setcolor(8);
line(65,360,565,360);
settextjustify(1,2);
for(i=0;i<11;i++){
line(j,375,j,360);
itoa(i,c,10);
outtextxy(j,380,c);
j+=xs;
}
}
void vDrawk(char c[]){
int i,j=360;
setcolor(8);
line(65,80,65,360);
settextjustify(1,1);
for(i=0;i<=5;i++){
line(45,j,65,j);
itoa(i,c,10);
outtextxy(35,j,c);
j-=ys;
}
}
void Drawfline(int b[]){
int i,j=65;
setcolor(1);
moveto(j,360-(b[0]*ys));//移动光标到(j,360-(b[0]*ys)处
for(i=0;i<10;i++){
if(i!=0){
lineto(j+xs,360-(b[i]*ys));
}
j+=xs;
}
}
void main(){
int j;
int gdrive=DETECT,gmode=0;
int b[]={1,4,2,5,3,5,1,4,2,3};
char c[10];
initgraph(&gdrive,&gmode,"");//图形模式初始化
setbkcolor(15);
setcolor(6);
outtectxy(150,50,"the value along with the month changing!");//输出字符串
hDrawk(c);
setcolor(8);
outtextxy(580,365,"month");//输出字符串
vDrawk(c);
setcolor(8);
outtextxh(65,70,"value");//输出字符串
Drawfline(b);
getch();
closegraph();
}