提交时间:2019-09-16 12:42:16

运行 ID: 67

#include<iostream> int main(){ int a,b; scanf("%d %d",&a,&b); switch(b){ case 1:printf("%d",31);break; case 2: if(a%4==0){ if(a%100==0){ if(a%400==0) printf("%d",29); else printf("%d",28); }else{ printf("%d",29); } }else{ printf("%d",28); } break; case 3:printf("%d",31);break; case 4:printf("%d",30);break; case 5:printf("%d",31);break; case 6:printf("%d",30);break; case 7:printf("%d",31);break; case 8:printf("%d",31);break; case 9:printf("%d",30);break; case 10:printf("%d",31);break; case 11:printf("%d",30);break; case 12:printf("%d",31);break; default:printf("error"); } return 0; }