输入年份和月份输出天数,为啥会输出-858993460
#include <stdio.h>void main()
{ int a,b,c,leap;
scanf("%d%d\n",&a,&b);
leap=( a%4==0 && a%100!=0 || a%400==0 );
switch(b)
{ case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: c=31; break;
case 4:
case 6:
case 9:
case 11: c=30; break;
case 2: c=28+leap; break;
}
printf("%d\n",c);
}