forked from derekhh/HackerRank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary-fine.cpp
More file actions
30 lines (27 loc) · 884 Bytes
/
library-fine.cpp
File metadata and controls
30 lines (27 loc) · 884 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
/*
library-fine.cpp
Library Fine
My first submission got WA because of a typo. I've mistyped 500 as 50.
*/
#include <iostream>
using namespace std;
int main() {
int returnDay, returnMonth, returnYear;
cin >> returnDay >> returnMonth >> returnYear;
int expectDay, expectMonth, expectYear;
cin >> expectDay >> expectMonth >> expectYear;
if ((returnYear < expectYear) ||
(returnYear == expectYear && returnMonth < expectMonth) ||
(returnYear == expectYear && returnMonth == expectMonth &&
returnDay <= expectDay)) {
cout << 0 << endl;
} else if (returnYear == expectYear && returnMonth == expectMonth &&
returnDay > expectDay) {
cout << 15 * (returnDay - expectDay) << endl;
} else if (returnYear == expectYear) {
cout << 500 * (returnMonth - expectMonth) << endl;
} else {
cout << 10000 << endl;
}
return 0;
}