update cout

This commit is contained in:
Pavel 2020-09-26 22:03:47 +02:00
parent 5b2e63ce7c
commit 0753d62e98
1 changed files with 9 additions and 1 deletions

View File

@ -135,7 +135,15 @@ def fix_angle(a):
return a * 2 * asin(1) / pi
def cout(x):
return len(str(round(abs(x)/1.,5)))
n, c = 5, 1
x = round(abs(x) * 10**n)
if x:
c = max(n + 1 - len(str(x)), 0)
while n and not (x % 10):
x = x // 10
n -= 1
c += not n
return 1 + len(str(x)) + c
def tourner(a):
global state