1
已解决
方宇哲
资深守护
资深守护
#include<iostream> #include<cstdio> using namespace std; int main() { int a,b; cin>>a>>b; if(b!=1&&b!=2&&b!=3&&b!=4&&b!=5&&b!=6&&b!=7&&b!=8&&b!=9&&b!=10&&b!=1&&b!=12) { cout<<"Error!"; }else if(b==1||b==3||b==5||b==7||b==8||b==10||b==12) { cout<<"31"; }else if(b==4||b==6||b==9||b==10){ cout<<"30"; }else if(b==2&&a%4==0&&a%100!=0) { cout<<"29"; }else { cout<<"28"; } return 0; }
0
0
0
0
0
0
0
李奕歌
初级天翼
初级天翼
switch(month)
{
case 2: day=29;
break;
case 4: day=30;
break;
case 6: day=30;
break;
case 9: day=30;
break;
case 11: day=30;
break;
default: day=31;
break;
}
}
else
{
switch(month){
case 2: day=28;
break;
case 4: day=30;
break;
case 6: day=30;
break;
case 9: day=30;
break;
case 11: day=30;
break;
default: day=31;
break;
}
}