solved hackerrank.library.fine

Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
ayham 2021-05-15 14:35:52 +03:00
parent ab530893ec
commit e246270235
No known key found for this signature in database
GPG Key ID: 81D38F7122AFCC94
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int d1, m1, y1;
int d2, m2, y2;
cin >> d1 >> m1 >> y1;
cin >> d2 >> m2 >> y2;
if (y1>y2) cout << "10000" << endl;
else if (y1<y2) cout << "0" << endl;
else if (m1>m2) cout << to_string(500*abs(m1-m2)) << endl;
else if (m1<m2) cout << "0" << endl;
else if (d1>d2) cout << to_string(15*abs(d1-d2)) << endl;
else cout << "0" << endl;
return 0;
}