输入1~7中的任意一个数字,输出对应的星期几的英文单词.
#include"stdio.h"main(){inta;scanf("%d",&a);swith(a){case1:printf("Monday\n");break;c...
#include"stdio.h"
main()
{
int a;
scanf("%d",&a);
swith(a)
{
case 1:printf("Monday\n");break;
case 2:printf("Tuesday\n");break;
case 3:printf("Wednesday\n");break;
case 4:printf("Thursday\n");break;
case 5:printf("Friday\n"); break;
case 6:printf("Saturday\n");break;
case 7:printf("Sunday\n");break;
default:printf("error \n"); break;
}
}
帮我看看哪错了呗,应该怎么改 展开
main()
{
int a;
scanf("%d",&a);
swith(a)
{
case 1:printf("Monday\n");break;
case 2:printf("Tuesday\n");break;
case 3:printf("Wednesday\n");break;
case 4:printf("Thursday\n");break;
case 5:printf("Friday\n"); break;
case 6:printf("Saturday\n");break;
case 7:printf("Sunday\n");break;
default:printf("error \n"); break;
}
}
帮我看看哪错了呗,应该怎么改 展开
4个回答
展开全部
#include<iostream>
using namespace std;
int main()
{
char week[7][10]={"monday","tuesday","wednesday","thursday","friday","saturday","sunday"};
int n;
cin>>n;
if(n>0&&n<8)
cout<<week[n-1];
else
cout<<"invalid";
return 0;
}
using namespace std;
int main()
{
char week[7][10]={"monday","tuesday","wednesday","thursday","friday","saturday","sunday"};
int n;
cin>>n;
if(n>0&&n<8)
cout<<week[n-1];
else
cout<<"invalid";
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
n different approaches to life as it was to try on a coat. The whole world, the whole future is stret
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
switch 不是swith
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询