首页 新闻 会员 周边 捐助

C++的新手,真心谢谢你们的帮助了。

0
悬赏园豆:20 [已解决问题] 解决于 2020-12-01 00:48

Activity 6

Write a program that asks the user for a number representing the day of the week and prints the name of the given day.

c++
心律的主页 心律 | 初学一级 | 园豆:136
提问于:2020-11-30 23:13
< >
分享
最佳答案
0
#include <iostream>
using namespace std;

int main()
{
    int number;
    cout<<"Please input the number: ";
    cin>>number;
    if(number==1)
    {
        cout<<"1 for Monday."<<endl;
    }
    else if(number==2)
    {
        cout<<"2 for Tuesday."<<endl;
    }
    else if(number==3)
    {
        cout<<"3 for Wednesday."<<endl;
    }
    else if(number==4)
    {
        cout<<"4 for Thursday."<<endl;
    }
    else if(number==5)
    {
        cout<<"5 for Friday."<<endl;
    }
    else if(number==6)
    {
        cout<<"6 for Saturday."<<endl;
    }
    else if(number==7)
    {
        cout<<"7 for Sundat."<<endl;
    }
    else
    {
        cout<<"Wrong number!"<<endl;
    }
    return 0;
}
展开代码内容
收获园豆:20
Conan-jine | 小虾三级 |园豆:1272 | 2020-12-01 00:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册