Week2

mail@pastecode.io avatar
unknown
python
a year ago
1.5 kB
3
Indexable
Never
Task 1
a = int(input())
b = int(input())
if a > b:
    print(a)
else:
    print(b)
    
Task 3
a = int(input())
b = int(input())
if a > b:
    print("1")
elif b > a:
    print("2")
else:
    print("0")

Task 5 ЗДЕСЬ ПРОБЛЕМКА!
k = int(input())
if k % 100 in [11, 12, 13, 14]:
    print(k, "srudentov")
elif k % 10 == 1:
    print(k, "student")
elif k % 10 == 2 or k % 10 == 3 or k % 10 == 4:
    print(k, "studenta")   
else:
    print(k, "studentov")

Task 7
x = int(input())
y = int(input())
if x in range(2,8) and y in range(2,8):
    moves = 8
elif x in [1,8] and y in range(2,8):
    moves = 5
elif x in range(2,8) and y in [1,8]:
    moves = 5
elif x in [1,8] and y in [1,8]:
    moves = 3
print(moves)

Task 9
x = int(input())
y = int(input())
if x % 2 == 0 and y % 2 == 0:
    print("BLACK")
elif x % 2 == 1 and y % 2 == 0:
    print("WHITE")
elif x % 2 == 0 and y % 2 == 1:
    print("WHITE")
elif x % 2 == 1 and y % 2 == 1:
    print("BLACK")

Task 11
a = int(input())
if a % 3 == 0 and a % 5 == 0:
    print("Fizz Buzz")
elif a % 3 == 0:
    print("Fizz")
elif a % 5 == 0:
    print("Buzz")
else:
    print(a) 

Task 13
x1 = float(input())
y1 = float(input())
x2 = float(input())
y2 = float(input())
if x1 > 0 and x2 > 0:
    if (y1 > 0 and y2 >0) or (y1 < 0 and y2 < 0):
        print("YES")
    else:
        print("NO")
elif x1 < 0 and x2 < 0:
    if (y1 > 0 and y2 >0) or (y1 < 0 and y2 < 0):
        print("YES")
    else:
        print("NO")
else:
    print("NO")