qingni
2015-12-14 15:54
“输出一个0~6的整数,转换为星期”怎样做
#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;
}
http://www.imooc.com/qadetail/109820
已经回复过了
C语言入门
926214 学习 · 20797 问题
相似问题