问答详情
源自:6-5 数组的应用(一)

“输出一个0~6的整数,转换为星期”怎样做

 “输出一个0~6的整数,转换为星期”怎样做

提问者:qingni 2015-12-14 15:54

个回答

  • 越飞越高
    2016-11-02 19:24:00

    #include<iostream.h>
    int main()
    {
    int a;
    cin>>a;
    switch(a)
    {
    case 0:cout<<"Sunday"<<endl;
    break;
    case 1:cout<<"Monday"<<endl;
    break;
    case 2:cout<<"Tuseday"<<endl;
    break;
    case 3:cout<<"Wednesday"<<endl;
    break;
    case 4:cout<<"Thursday"<<endl;
    break;
    case 5:cout<<"Friday"<<endl;
    break;
    case 6:cout<<"Saturday"<<endl;
    break;
    default:cout<<"Please input 0~6"<<endl;
    break;
    }
    return 0;
    }

  • RockenRoll
    2015-12-15 09:32:23

    http://www.imooc.com/qadetail/109820

  • RockenRoll
    2015-12-14 16:14:13

    已经回复过了