[求助]编译通过,但输入第二个字母无显示!
请高手诊断为什么会出错!#include <stdio.h>
void main()
{
char letter;
printf("please input the first letter of someday\n");
while ((letter=getchar())!='Y')/*当所按字母为Y时才结束*/
{
switch (letter)
{
case 'S':printf("please input second letter\n");
if((letter=getchar())=='a')
printf("saturday\n");
else if ((letter=getchar())=='u')
printf("sunday\n");
else printf("data error\n");break;
case 'F':printf("friday\n");break;
case 'M':printf("monday\n");break;
case 'T':printf("please input second letter\n");
if((letter=getchar())=='u')
printf("tuesday\n");
else if ((letter=getchar())=='h')
printf("thursday\n");
else printf("data error\n");
break;
case 'W':printf("wednesday\n");break;
default: printf("data error\n");
}
}
}