#include <stdio.h>
int main(){
int year,month,day;
scanf("%d %d",&year,&month);
switch(month){
case 1:
day = 31;
case 2:
day = (year%100?year%400:year%4)?29:28;
}
printf("%d",day);
}
输入 19 1 时,会输出29,请问这是怎么回事啊?
C:\Users\admin\Documents\c2.cpp In function 'int main()':
7 8 C:\Users\admin\Documents\c2.cpp [Warning] this statement may fall through [-Wimplicit-fallthrough=]
8 3 C:\Users\admin\Documents\c2.cpp [Note] here