#include <stdio.h>
int main()
{
int a,b,c;
CW:printf("请输入日期(格式:日_月_年):");
scanf("%d %d %d",&a,&b,&c);
if(a > 31 || a < 1 || b > 12 || b < 1)
{
printf("输入错误,");
goto CW;
}
else
{
switch(a)
{
case 1: case 21: case 31:
printf("%dst ",a);
break;
case 2: case 22:
printf("%dnd ",a);
break;
case 3: case 23:
printf("%drd ",a);
break;
defult:
printf("%dth ",a);
break;
}
switch(b)
{
case 1:
printf("January ");
break;
case 2:
printf("February ");
break;
case 3:
printf("March ");
break;
case 4:
printf("April ");
break;
case 5:
printf("May ");
break;
case 6:
printf("June ");
break;
case 7:
printf("July ");
break;
case 8:
printf("August ");
break;
case 9:
printf("September ");
break;
case 10:
printf("October ");
break;
case 11:
printf("November ");
break;
case 12:
printf("December ");
}
}
printf("%d\n",c);
return 0;
}
慕粉15222296232
相关分类