本文共 796 字,大约阅读时间需要 2 分钟。
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
void uh() //判断周二还是周三
{ char sec;
printf("请继续输入:\n");
bq:scanf("%c",&sec);
if(sec=='u'||sec=='U')
printf("It is Tuesday!\n");
else if(sec=='H'||sec=='h')
printf("It is Thursday!\n");
else
{
goto bq;
}
}
void au()//判断周六还是周日
{ char sec;
printf("请继续输入:\n");
bq:scanf("%c",&sec);
if(sec=='a'||sec=='A')
printf("It is Saturday!\n");
else if(sec=='u'||sec=='U')
printf("It is Sunday!\n");
else
{
goto bq;
}
}
void main()
{
char fir;
printf("请输入字母:");
bq:scanf("%c",&fir);
switch(fir)
{
case 'm':
case 'M':printf("Monday\n");break;
case 't':
case 'T':printf("Tuesday,Thursday?\n");
uh();
break;
case 'w':
case 'W':printf("Wendnesday\n");break;
case 'f':
case 'F':printf("Friday\n");break;
case 's':
case 'S':printf("Saturday,Sunday?\n");
au();
break;
default :goto bq;
}
}
转载地址:http://ucnzx.baihongyu.com/