IF and ELSE

#include 
int main()
{
    int m = 0;
    printf("请输入一个月份(1~12):");
    scanf("%d",&m);
if(m=1)
            printf("January\n");
else if(m=2)
            printf("February\n");
else if(m=3)
            printf("March\n");
else if(m=4)
            printf("April\n");
else if(m=5)
            printf("May \n");
else if(m=6)
            printf("June \n");
else if(m=7)
            printf("July\n");
else if(m=8)
            printf("August \n");
else if(m=9)
            printf("September \n");
else if(m=10)
            printf("October \n"); 
else if(m=11)
            printf("November \n");
else if(m=12)
            printf("December\n");
else  
            printf("Error \n");
    }
    return 0;
}

你可能感兴趣的:(IF and ELSE)