Last active
October 6, 2016 19:55
-
-
Save dmfilipenko/06409c6d4eed10cdaab5f0cf2acea2f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
1. «Sum of three numbers» | |
""" | |
a = int(input()) | |
b = int(input()) | |
c = int(input()) | |
print(a + b + c) | |
""" | |
2. «Area of a right triangle» | |
""" | |
b = int(input()) | |
h = int(input()) | |
print(b*h/2) | |
""" | |
3. «Apple sharing» | |
""" | |
n = int(input()) | |
k = int(input()) | |
print(k // n) | |
print(k % n) | |
""" | |
4. «Digital clock» | |
""" | |
n = int(input()) | |
hours_raw = n // 60 | |
hours = 0 if hours_raw == 24 else hours_raw | |
minutes = n % 60 | |
if hours > 24: | |
print(hours - (hours // 24) * 24, minutes) | |
else: | |
print(hours, minutes) | |
""" | |
5. «Hello, Harry!» | |
""" | |
a = input() | |
print('Hello, {0}!'.format(a)) | |
""" | |
6. «Previous and next» | |
""" | |
a = int(input()) | |
print('The next number for the number {0} is {1}.'.format(a, a + 1)) | |
print('The previous number for the number {0} is {1}.'.format(a, a - 1)) | |
""" | |
7. «School desks» | |
""" | |
group_1 = int(input()) | |
group_2 = int(input()) | |
group_3 = int(input()) | |
res = group_1 // 2 + group_1 % 2 + \ | |
group_2 // 2 + group_2 % 2 + \ | |
group_3 // 2 + group_3 % 2 | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment