mirror of
https://github.com/tiennm99/CTDL-GT.git
synced 2026-06-09 22:11:20 +00:00
27 lines
362 B
C++
27 lines
362 B
C++
#include <iostream>
|
|
using namespace std;
|
|
bool isLeapYear(int n)
|
|
{
|
|
if ((n % 4 == 0 && n % 100 != 0) || n % 400 == 0)
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
int main()
|
|
{
|
|
int n;
|
|
cout << "Nhap so nam:" << endl;
|
|
cin >> n;
|
|
if (isLeapYear(n))
|
|
{
|
|
cout << "YES";
|
|
}
|
|
else
|
|
{
|
|
cout << "NO";
|
|
}
|
|
cout << endl;
|
|
system("pause");
|
|
return 0;
|
|
} |