Найдите лечебный год
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
Homely Hoopoe
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
cout<<year<<" is a leap year";
else
cout<<year<<" is not a leap year";
$day = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
$year = 2021;
if (($year % 4 == 0 && $year % 100 != 0) || ($year % 400 == 0)) {
$day = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
echo "This is leap year - get 366 day";
} else {
echo "This is NOT leap year - get ONLY 365 day";
}
#include<iostream>
using namespace std;
int main() {
int year = 2016;
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
cout<<year<<" is a leap year";
else
cout<<year<<" is not a leap year";
return 0;
}