-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathProgram.cs
More file actions
24 lines (20 loc) · 740 Bytes
/
Program.cs
File metadata and controls
24 lines (20 loc) · 740 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
using System;
namespace Day_of_the_Programmer {
class Program {
public static string DayOfProgrammer(int year) {
if (year < 1918) { // Julian
if (year % 4 == 0)return $"12.09.{year}";
} else if (year > 1918) { // Gregorian
if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)) return $"12.09.{year}";
} else { // Transaction Year
return $"26.09.{year}";
}
return $"13.09.{year}";
}
static void Main(string[] args) {
int year = Convert.ToInt32(Console.ReadLine().Trim());
string result = DayOfProgrammer(year);
Console.WriteLine(result);
}
}
}