//输入一个整数day代表星期几,输入对应的星期几,比如day==1,输出“星期一”
#include<stdio.h>
int main ()
{
int day;
printf ("请输入一个整数:\n");
scanf ("%d",&day );
if (1 == day)
{
printf ("星期一");
}
else if (2 == day)
{
printf ("星期二");
}
else if (3 == day)
{
printf ("星期三");
}
else if (4 == day)
{
printf ("星期四");
}
else if (5 == day)
{
printf ("星期五");
}
else if (6 == day)
{
printf ("星期六");
}
else if (7 == day)
{
printf ("星期日");
}
else
{
printf ("屌丝输错啦\n");
}
return 0 ;
} |
|