“输出一个0~6的整数,转换为星期”怎样做
“输出一个0~6的整数,转换为星期”怎样做
“输出一个0~6的整数,转换为星期”怎样做
2015-12-14
#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;
}
举报