91学习

陪伴你每一天!

判断月份属于哪个季节

#include <stdio.h>


int main(){

int month;

printf("please enter a month:\n");

scanf("%d",&month);

switch(month){

case 3:

case 4:

case 5:

printf("%d  is spring\n",month);

break;

case 6:

case 7:

case 8:

printf("%d  is summer\n",month);

break;

case 9:

case 10:

case 11:

printf("%d  is autumn\n",month);

break;

case 12:

case 1:

case 2:

printf("%d  is winter\n",month);

break;

}

return 0;

}

POSji18790284560.png

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。