2、34567qwertyuasdfghj";x=100;settextstyle(0,0,2);outtextxy(90,100,"PleaseuseA-Utomakesound");settextstyle(0,0,1);outtextxy(120,320,"PressESCtoexit.");setcolor(RED);for(i=0;i<21;i++){ch[0]=str[i];ch[1]=0;outtextxy(x+5,160,ch);x+=20;}return(0);}donghua(){inti,j,x,ste
3、px=100,stepy=180;charch,str[2];unsignedintfre;wenzixianshi();while(1){setcolor(BLUE);for(i=0;i<21;i++){rectangle(stepx+i*20,stepy+0,stepx+i*20+20,stepy+100);}ch=bioskey(0);if(ch==27)break;/*frq[3][7]={262,294,330,349,392,440,494,524,587,659,698,784,880,988,1024,1
4、174,1318,1396,1568,1760,1976};*/switch(ch){case'1':i=0;j=262;break;case'2':i=1;j=294;break;case'3':i=2;j=330;break;case'4':i=3;j=349;break;case'5':i=4;j=392;break;case'6':i=5;j=440;break;case'7':i=6;j=494;break;case'q':i=7;j=524;break;case'w':i=8;j=587;break;case
5、'e':i=9;j=659;break;case'r':i=10;j=698;break;case't':i=11;j=784;break;case'y':i=12;j=880;break;case'u':i=13;j=988;break;case'a':i=14;j=1024;break;case's':i=15;j=1174;break;case'd':i=16;j=1318;break;case'f':i=17;j=1396;break;case'g':i=18;j=1568;break;case'h':i=19;
6、j=1760;break;case'j':i=20;j=1976;break;default:continue;}setfillstyle(1,15);bar(stepx+i*20,stepy+0,stepx+i*20+20,stepy+100);sound(j);my_delay(3);nosound();setfillstyle(1,0);bar(stepx+i*20,stepy+0,stepx+i*20+20,stepy+100);}return(0);}main(){intmode;intdriver=DETEC
7、T;initgraph(&driver,&mode,"");cleardevice();donghua();closegraph();return(0);}