闰年判断代码模板
//函数定义
bool leap(int n){if(n%400==0 || (n%100!=0 && n%4==0))return true;elsereturn false;
}
//函数调用示例
if(leap(year) && month==2)cout<<29;
//函数定义
bool leap(int n){if(n%400==0 || (n%100!=0 && n%4==0))return true;elsereturn false;
}
//函数调用示例
if(leap(year) && month==2)cout<<29;