-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3d.cc
44 lines (42 loc) · 751 Bytes
/
3d.cc
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
#include <iostream>
int main() {
int month;
int year;
std::cin >> month >> year;
switch (month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
std::cout << 31 << std::endl;
break;
case 2:
if (year % 400 == 0)
{
std::cout << 29 << std::endl;
}
else if (year % 100 == 0)
{
std::cout << 28 << std::endl;
}
else if (year % 4 == 0)
{
std::cout << 29 << std::endl;
}
else
{
std::cout << 28 << std::endl;
}
break;
case 4:
case 6:
case 9:
case 11:
std::cout << 30 << std::endl;
break;
}
}