编一程序,输人月份号,输出该月的英文月名。例如,输人3,则输出March。要求用指针数组处理。

代码:

#include <stdio.h>
int main(){
    char *month[12]={"January","February","March","April","May" ,"June",
    "July" ,"August","September" ,"October","November","December"};
    int n;
    printf("input month:\n");
    scanf("%d",&n);
    if ((n<=12)&&(n>=1))
    printf("It is %s. \n", *(month+n-1));
    else
    printf("It is wrong. \n");
    return 0;
}

运行结果:
编一程序,输人月份号,输出该月的英文月名。例如,输人3,则输出March。要求用指针数组处理。

上一篇:Codeforces Round #602 (Div. 2, based on Technocup 2020 Elimination Round 3) A. Math Problem 水题


下一篇:SYSAUX and purging big objects (segments) manually