用指针将月份转换成英文

#include <stdio.h>
int main(int argc, char **argv)
{
    char *sm[12]={"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
    int m;
    printf("input month  1 or 2....or12");
    scanf("%d",&m);
    printf("It is %s\n",*(sm+1+m));
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_42164474/article/details/80558651