滿意答案

kcaqxp
2013.04.25

采納率:57% 等級:12
已幫助:7051人
為了節省時間,我用簡寫吧
#include
#include
#define N 12
static const char *g_EngMon[N] =
{
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Dec",
"Nov",
"Dec",
};
void main()
{
char month[20];
int status = 0;
memset(month, 0x0, sizeof(month));
do
{
printf("please input english month:\n");
scanf("%s", month);
for(int i = 0; i < N; i++)
{
status = stricmp(month, g_EngMon[i]);
if( status == 0)
{
printf("Month: %d\n", i+1);
}
}
fflush(stdin);
}while(1);
}
00分享舉報