输入一个数字 (1-7) ,用英文显示对应的星期一到星期日。提示:用c语句来实现
展开全部
printf({"xingqi1","xingqi2","xingqi3","xingqi4","xingqi5","xingqi6","xingqi7"}[i - 1]);
那个把里面的英文换一下……然后i是那个数字,可以用scanf("%d", &i)来取得
那个把里面的英文换一下……然后i是那个数字,可以用scanf("%d", &i)来取得
追问
我太菜了 你完整了来一段 分可以追加给你点
追答
不好意思啊上面写错了
#include
char* names[] = {"xingqi1","xingqi2","xingqi3","xingqi4","xingqi5","xingqi6","xingqi7"};
int main()
{
int i = 1;
scanf("%d", &i);
printf(names[i - 1]);
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询