S001-AC.cc
687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
using namespace std;
bool is_leap_year(int year)
{
if(!(year - (year/100)*100))
{
if(!((year/100)%4))
{
return true;
}
return false;
}
if(!(year%4))
{
return true;
}
return false;
}
bool is_valid_date(int d, int m, int y)
{
if(d <= 0 || d >= 32 || (m == 2 && d >= 30))
{
return false;
}
if(m <= 0 || m >= 13)
{
return false;
}
if(d == 31 && (m == 4 || m == 6 || m == 9 || m == 11))
{
return false;
}
if((!is_leap_year(y)) && m == 2 && d == 29)
{
return false;
}
return true;
}
int main()
{
/*
int a;
cin >> a;
if(is_leap_year(a))
{
cout << "TRUE" << endl;
}
else
{
cout << "FALSE" << endl;
}
return 0;
*/
}