Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- bonus = 0
- if n < 101:
- bonus = 5
- elif n < 1001:
- bonus = n * 0.2
- else:
- bonus = n * 0.1
- if n % 2 == 0:
- bonus += 1
- elif n % 5 == 0:
- bonus += 2
- print(bonus)
- print(n + bonus)
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
- n = int(input())
- bonus = (5 if n < 101 else n * (0.2 if n < 1001 else 0.1)) + (1 if n % 2 == 0 else 2 if n % 5 == 0 else 0)
- print(f'{bonus}\n{bonus + n}')
Add Comment
Please, Sign In to add comment