#include <stdio.h>
int main(int argc, char *argv[])
{
char *months[12] = {"January","February","Marcy","April","May","June","July","August","September","October","November","December"};
char **p;
p = months;
int i_month,i = 0;
printf("please input months number(1 - 12):");
scanf("%d",&i_month);
while (i_month > 12 || i_month < 1)
{
printf("you input number is error,please reinput(1 - 12):");
scanf("%d",&i_month);
}
while (++i != i_month)
{
p++;
}
printf("the %d month english is %s.\n",i_month,*p);
system("pause");
return 0;
}
|