编写的电子琴程序编译时找不到一个头文件
#include <stdio.h>#include <stdlib.h>
#include <dos.h>
#include <conio.h>
#include <graphics.h>
#define stage=8100
int frq[3][7]={262,294,330,349,392,440,494,524,587,659,698,784,880,988,1024,1174,1318,1396,1568,1760,1976};
int mx,my,x,y,step=16;
int i=0,j=0;
char key=0;
int yun,preyun;
void beginning()
{ int driver=DETECT,mode;
initgraph(&driver,&mode,"");
setcolor(6);
settextstyle(1,0,2);
outtextxy(x+100,y+40,"Welcome to my");
setcolor(4);
settextstyle(1,0,0);
outtextxy(x+100,y+100,"COMPUTER PIANO");
setcolor(3);
settextstyle(1,0,3);
outtextxy(x+100,y+130,"Press anykey to continue...");
getch();
cleardevice();
}
void disp_piano()
{ int driver=DETECT,mode;
int i,j;
initgraph(&driver,&mode,"");
x=mx-(21*step)/2;
y=my-20;
setcolor(0);
rectangle(x,y,x+21*step+1,y+100);
rectangle(x-1,y-1,x+21*step+2,y+101);
setcolor(10);
rectangle(x+2,y+50,x+21*step-1,y+98);
setfillstyle(1,10);
floodfill(x+10,y+60,15);
setcolor(3);
for(i=x+step;i<x+21*step;i+=step)
line(i,y+50,i,y+99);
setcolor(0);
rectangle(x-40,y-20,x+21*step+40,y+130);
rectangle(x-41,y-21,x+21*step+41,y+131);
rectangle(x-41,y-25,x+21*step+41,y-24);
rectangle(x-41,y-22,x-40,y-53);
rectangle(x+21*step+40,y-22,x+21*step+41,y-53);
rectangle(x-1,y-93,x+21*step+1,y-92);
arc(x-1,y-53,90,180,40);
arc(x-1,y-53,90,180,39);
arc(x+21*step+1,y-53,0,90,40);
arc(x+21*step+1,y-53,0,90,39);
rectangle(x+43,y-80,x+21*step-43,y-35);
for(i=x+49;i<x+21*step-48;i+=12)
{ setfillstyle(1,15);
bar(i,y-75,i+9,y-40);
j=random(24);
setfillstyle(2,11);
bar(i,y-75+j,i+9,y-65+j);
}
rectangle(x-32,y-50,x+33,y-40);
setfillstyle(1,15);
floodfill(x-30,y-10,3);
setfillstyle(10,10);
floodfill(x-39,y-27,3);
setcolor(3);
circle(x+21*step-5,y-70,6);
circle(x+21*step-5,y-45,6);
setfillstyle(1,4);
floodfill(x+21*step-5,y-70,11);
floodfill(x+21*step-5,y-45,11);
outtextxy(x-30,y-65,"VOLUME");
setcolor(10);
outtextxy(x+110,y+112,"COMPUTER PIANO");
setcolor(15);
settextstyle(2,0,5);
outtextxy(x-15,y+140,"Help:Esc to quit.");
}
void press_line(int i,int j,int color1,int color2)
{ int dt;
dt=(i*7+j)*step;
setcolor(color1);
if((i!=0)||(j!=0))
line(x+1+dt,y+50,x+1+dt,y+98);
line(x+2+dt,y+50,x+2+dt,y+98);
line(x+dt+step-1,y+50,x+dt+step-1,y+98);
line(x+dt+step-2,y+50,x+dt+step-2,y+98);
setcolor(color2);
line(x+3+dt,y+18,x+3+dt,y+49);
line(x+4+dt,y+18,x+4+dt,y+49);
}
void set_volume(int i,int j,int color)
{ int t,s;
s=i*7+j+1;
setcolor(color);
for(t=0;t<s;t++)
rectangle(x-32+t*3,y-48,x-29+t*3,y-42);
}
void main()
{ nosound();
mx=320;
my=240;
beginning();
disp_piano();
while(key!=27)
{ yun=0;
key=getch();
if(i<3&&j<7)
{ nosound();
press_line(i,j,15,0);
set_volume(i,j,0);
}
switch(key)
{ case 122:
i=0;
j=0;
break;
case 120:
i=0;
j=1;
break;
case 99:
i=0;
j=2;
break;
case 118:
i=0;
j=3;
break;
case 98:
i=0;
j=4;
break;
case 110:
i=0;
j=5;
break;
case 109:
i=0;
j=6;
break;
case 97:
i=1;
j=0;
break;
case 115:
i=1;
j=1;
break;
case 100:
i=1;
j=2;
break;
case 102:
i=1;
j=3;
break;
case 103:
i=1;
j=4;
break;
case 104:
i=1;
j=5;
break;
case 106:
i=1;
j=6;
break;
case 113:
i=2;
j=0;
break;
case 119:
i=2;
j=1;
break;
case 101:
i=2;
j=2;
break;
case 114:
i=2;
j=3;
break;
case 116:
i=2;
j=4;
break;
case 121:
i=2;
j=5;
break;
case 117:
i=2;
j=6;
break;
}
if(i<3&&j<7)
sound(frq[i][j]);
if(key<97||key>122) nosound();
if((yun||key!='0')&&(yun!=-1)&&(i<3&&j<7))
{press_line(i,j,0,15);
set_volume(i,j,10);}
}
}
void nosound();
void far closegraph();
同学编的,发过来我编译时找不到头文件#include <graphics.h>。