theoinf-exercise/exercise_1/task3-l.py
2026-04-30 16:08:36 +02:00

23 lines
301 B
Python

def divtwo(x):
y=0
z=0
if (x>=0):
z=x
while ((z-y)>1):
z=(z-1)
y=(y+1)
return y
def bin(x):
z=0
y=1
if (x>0):
y=divtwo(x)
z=(x-(y+y))
print(z)
x=y
else:
print(0)
return 0
print(bin(2))