test
#include<stdio.h>#include<string.h>
//返回目标月份在12标准月中的索引值
int nindex(char * destmonth)
{
int s=99;
char * months[12] =
{
"January","February","March","April","May","June",
"July","August","September","October","November","December"
};
for(int i=0;i<12;i++)
{
if(strcmp(months[i],destmonth)==0)
{
s=i;
break;
}
}
return s;
}
int main()
{
char * months[12] =
{
"January","February","March","April","May","June",
"July","August","September","October","November","December"
};
char * mp[10] =
{
"January 01 01","January 01 00","February 28 99","July 17 12","September 10 12",
"July 01 00","June 30 90","August 25 06","May 27 08","October 01 03"
};
int i,j;
for(i=0;i<12;i++)
{
for(j=0;j<10;j++)
{
if(strcmp(months[i],mp[j])==0) printf("%s\n",mp[j]);
}
}
return 0;
}