Please Login in order to post a comment
d1,m1,y1 = map(int,input().split()) #given to lib d2,m2,y2 = map(int,input().split()) #Should give to lib fine = None if y1 > y2: fine = 10000 elif y1 == y2 and m1 > m2: fine = 500*(m1-m2) elif y1 == y2 and m1 == m2 and d1 > d2: fine = 15*(d1-d2) else: fine = 0 print(fine)
date_returned = list(map(int, input().split(' '))) date_expected = list(map(int, input().split(' '))) if date_returned[2] > date_expected[2]: fine = 10000 elif date_returned[2] == date_expected[2]: if date_returned[1] > date_expected[1]: fine = 500 * (date_returned[1] - date_expected[1]) elif date_returned[0] > date_expected[0]: fine = 15 * (date_returned[0] - date_expected[0]) else: fine = 0 else: fine = 0
from datetime import date i1 = [int(e) for e in input().split(" ")] return_date = date(i1[2], i1[1], i1[0]) i2 = [int(e) for e in input().split(" ")] expected_return_date = date(i2[2], i2[1], i2[0]) fine = 0 if return_date > expected_return_date: if return_date.year != expected_return_date.year: fine = 10000 elif return_date.month != expected_return_date.month: fine = 500 * (return_date.month - expected_return_date.month) else: fine = 15 * (return_date.day - expected_return_date.day) print(str(fine))
date_returned, month_return, year_return=input().split(" ") date_due, month_due, year_due=input().split(" ") date_returned, month_return, year_return = int(date_returned), int(month_return), int(year_return) date_due, month_due, year_due = int(date_due), int(month_due), int(year_due) if date_returned<= date_due and month_return<=month_due and year_return<=year_due: print(int(0)) if date_returned> date_due and month_return>month_due and year_return<year_due: print(int(0)) if date_returned> date_due and month_return<=month_due and year_return<=year_due: fine=int(15*(date_returned-date_due)) print(fine) if month_return>month_due and year_return==year_due: fine = int((month_return-month_due)*500) print(fine) if year_return>year_due: print(int(10000))
private static int crazyFee(int d, int m, int y, int dd, int dm, int dy) { return ((y << 9) | (m << 5) | d) <= ((dy << 9) | (dm << 5) | dd) ? 0 : (y ^ dy) == 0 && (m ^ dm) == 0 ? 15 * (d - dd) : (y ^ dy) == 0 ? 500 * (m - dm) : 10000; } and of course "python" style =)
Seems like cookies are disabled on this browser, please enable them to open this website
Please Login in order to post a comment