C语言编程题:从键盘上输入星期号,并显示该星期的英文名称
展开全部
#include<stdio.h>
int main()
{int w=8;
char week[][10]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
while(w<0||w>7)
{printf("请输入0~6表示的星期几:");
scanf("%d",&w);
}
printf("该天是%s\n",week[w]);
return 0;
}
int main()
{int w=8;
char week[][10]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
while(w<0||w>7)
{printf("请输入0~6表示的星期几:");
scanf("%d",&w);
}
printf("该天是%s\n",week[w]);
return 0;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询