//编写程序,提示用户输入年份和月份,显示这个月的天数。
//例如,输入年份为2016,月份为2,则应输出29天。闰年366天,2月29天;平年365天,2月28天
//被4整除,不能被400整除的是闰年,整百的年份同时也要求被400整除
#include<iostream>
using namespace std;
int main(){
int Yea,Month;
cout<<"输入年份:"<<endl;
cin>>Yea;
cout<<"输入月份:"<<endl;
cin>>Month;
if(Yea%4==0 && Yea%100!=0 || Yea%400==0){ //满足能被4整除,且不能被100整除;或者能被400整除
cout<<"这是润年"<<endl;
if(Month==1||Month==3||Month==5||Month==7||Month==8||Month==10||Month==12){
cout<<"这个月31天"<<endl;
}
else if(Month==4||Month==6||Month==9||Month==11){
cout<<"这个月30天"<<endl;
}
else
cout<<"这个月29天"<<endl;
}
else{
cout<<"这不是润年"<<endl;
if(Month==1||Month==3||Month==5||Month==7||Month==8||Month==10||Month==12){
cout<<"这个月31天"<<endl;
}
else if(Month==4||Month==6||Month==9||Month==11){
cout<<"这个月30天"<<endl;
}
else
cout<<"这个月28天"<<endl;
}
}