#include<conio.h>
#include<windows.h>
#define M1 Beep(523,200);
#define M2 Beep(587,200);
#define M3 Beep(659,200);
#define M4 Beep(698,200);
#define M5 Beep(784,200);
#define M6 Beep(880,200);
#define M7 Beep(980,200);
int main()
{
char ch;
while(1)
{
if(kbhit())
{
ch=getche();
switch(ch)
{
case '1':M1;break;
case '2':M2;break;
case '3':M3;break;
case '4':M4;break;
case '5':M5;break;
case '6':M6;break;
case '7':M7;break;
}
}
}
}
C/C++——超简陋钢琴的实现
最新推荐文章于 2022-01-03 13:46:30 发布