打印月份
#include<stdio.h>
#include<stdlib.h>int main(){
int year, mon;
while(scanf("%d%d",&year,&mon)!=EOF){
switch(mon){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
printf("month=%d is 31 days.\n",mon);break;
case 4:
case 6:
case 9:
case 11:
printf("month=%d is 30 days.\n",mon);break;
case 2:
printf("month=%d is %d days.\n",mon,28+(0==year%4&&year%100!=0||0==year%400));break;
default :
printf("error month\n");
}
}
system("pause");
return 0;
}