👤

Napisz program realizujący poniższy algorytm (schemat blokowy) Python

Napisz Program Realizujący Poniższy Algorytm Schemat Blokowy Python class=

Odpowiedź :

# by kubaczak

x = int(input("x = "))

y = int(input("y = "))

z = 5

x = x + 2

if x < y:

   x = x * z

   y = y - 1

else:

   if x == y:

       y = y - z

       x = x - 1

   else:

       y = y + z

       x = x + 1

print("x =", x, "y =", y)

x, y, z = int(input("x >> ")) + 2, int(input("y >> ")), 5

if x < y:

x, y = x * 2, y - 1

else:

if x == y:y = y -z, x - 1

else:y, x = y + z, x + 1

print(f"x {x}\ny {y}")