getch() 的作用
#include"stdio.h"void main()
{
char letter;
printf("Input letter the first letter of someday:\n");
while((letter=getch())!='y')
{
switch(letter)
{
case 's':printf("please input second letter:\n");
if((letter=getch())=='a')
printf("saturday\n");
else if((letter=getch())=='u')
printf("sunday\n");
else
printf("data is error\n");
break;
case 'f':
printf("friday\n"); break;
case 'm':
printf("monday\n"); break;
case 't':
printf("please input the second letter:\n");
if((letter==getch())=='u')
printf("tuesday\n");
else if((letter=getch())=='h')
printf("thursday\n");
else
printf("date is error\n");
break;
case 'w':
printf("wednesday\n");break;
default:
printf("data is error\n");break;
getch();
}
}
}
getch() 函数到底是干什么的啊 不是暂停的吗 怎么能用做输入 而且 程序还不段循环 遇到 break; 都跳不出来 具体看看这个程序