-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathProgram.cs
More file actions
31 lines (23 loc) · 941 Bytes
/
Program.cs
File metadata and controls
31 lines (23 loc) · 941 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
using System;
namespace Library_Fine {
class Program {
static int LibraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {
if (y1 > y2) return 10000;
if ((y1 == y2) && (m1 > m2)) return 500 * (m1 - m2);
if ((y1 == y2) && (m1 == m2) && (d1 > d2)) return 15 * (d1 - d2);
return 0;
}
static void Main(string[] args) {
string[] d1M1Y1 = Console.ReadLine().Split(' ');
int d1 = Convert.ToInt32(d1M1Y1[0]);
int m1 = Convert.ToInt32(d1M1Y1[1]);
int y1 = Convert.ToInt32(d1M1Y1[2]);
string[] d2M2Y2 = Console.ReadLine().Split(' ');
int d2 = Convert.ToInt32(d2M2Y2[0]);
int m2 = Convert.ToInt32(d2M2Y2[1]);
int y2 = Convert.ToInt32(d2M2Y2[2]);
int result = LibraryFine(d1, m1, y1, d2, m2, y2);
Console.WriteLine(result);
}
}
}