闰年:
能被4整除,不能被100整除。
能被4整除,也能被100整除。(能被400整除)
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) ){
std::cout << year << " is 闰年" << std::endl;
}
本文转载自:https://blog.csdn.net/limingandritchie/article/details/102700555
闰年:
能被4整除,不能被100整除。
能被4整除,也能被100整除。(能被400整除)
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0) ){
std::cout << year << " is 闰年" << std::endl;
}
本文转载自:https://blog.csdn.net/limingandritchie/article/details/102700555