作者seth0921 (最强一行文)
看板FJU-Stat97A
标题[闲聊] 做到一半回家作
时间Thu Jun 10 16:04:36 2010
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
int greee(int a[]);
int main(void)
{ int i,j=1,k;
int q[100]; /*题目阵列*/
int m[100]; /*输入阵列*/
int n[9]={262,295,332,352,395,443,497,524,588}; /*键盘阵列*/
srand(time(NULL));
/*先出题*/
do
{
q[i]=rand()%8+1; /*放入音符*/
for(i=0;i<=j;i++)
{ Beep(n[i],500);
Sleep(35);
}
}while(q[i]!=0); /*当q[i]阵列里面全部都不等於0就跳出*/
/*听完之後开始答题*/
for(y=1;y<=x;y++)
{ if(m[y]==n[y])
printf("good!");
else
printf("so sad");
}
system("pause");
return(0);
}
int greee(int a[])
{
char r;
do
{ r=getch();
switch(r)
{ case'1':
Beep(262,300);
break;
case'2':
Beep(295,300);
break;
case'3':
Beep(332,300);
break;
case'4':
Beep(352,300);
break;
case'5':
Beep(395,300);
break;
case'6':
Beep(443,300);
break;
case'7':
Beep(497,300);
break;
case'8':
Beep(524,300);
break;
case'9':
Beep(588,300);
break;
}
}while(r!='z');
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.136.162.59
1F:推 mark2323: 这个标题 不错 kerker118.167.133.106 06/10 17:31