你看看我的,我不过也有错误,帮个忙修改下
#include <stdio.h>
void main()
{
int month,date,year;
printf("Please Enter date (mm/dd/yy):\n ");/*请按mm/dd/yy格式输入*/
loop:{
scanf("%2d%2d%2d",&month, &date,&year);
if (month>12||date>31||year>99)
{
printf("Error!\n");
goto loop;
}
else switch(month)
{
case 1:month="January";break;
case 2:month=("February");break;
case 3:month=("March");break;
case 4:month=("April");break;
case 5:month=("May");break;
case 6:month=("June");break;
case 7:month=("July");break;
case 8:month=("August");break;
case 9:month=("September");break;
case 10:month=("Octorber");break;
case 11:month=("November");break;
case 12:month=("December");break;
default:printf("Error!\n");
goto loop;
}
switch(date)
{
case 01:printf("Dated this %dst day of %s,20%2d.\n",month,date,year);break;
case 02:printf("Dated this %dnd day of %s,20%2d.\n",month,date,year);break;
case 03:printf("Dated this %drd day of %s,20%2d.\n",month,date,year);break;
default:printf("Dated this %dth day of %s,20%2d.\n",month,date,year);break;
}
goto loop;
}
}