Skip to content
Snippets Groups Projects
Commit fd921a91 authored by Martin Mareš's avatar Martin Mareš
Browse files

Odmocnina: Trochu hezčí kód

parent 053a2a58
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
x = int(input())
# Odmocnina se nachazí v intervalu [l, p]
# Odmocnina se nachází v intervalu [l, p]
l = 0
p = x
......@@ -11,7 +11,7 @@ while l <= p:
stred = (l+p) // 2
pokus = stred**2
if pokus == x:
print("Odmocnina je", stred)
print(f"Odmocnina z {x} je {stred}")
break
elif pokus < x:
l = stred + 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment