Advertisement
Olegos

B

Apr 27th, 2023 (edited)
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | Sports | 0 0
  1.  
  2. a = str(float(input())).split('.')
  3. z = int(a[0])
  4.  
  5.  
  6. # x < z
  7. if z < 0:
  8.     x = z - 1
  9. else:
  10.     if a[1][0] == '0':
  11.         x = z - 1
  12.     else:
  13.         x = z
  14.  
  15.  
  16. # y > z
  17. if z < 0:
  18.     if a[1][0] == '0':
  19.         y = z + 1
  20.     else:
  21.         y = z
  22.  
  23. else:
  24.     y = z + 1
  25.  
  26. # z
  27. target = int(a[1][0])
  28. if target >= 5:
  29.     if z < 0:
  30.         z -= 1
  31.     else:
  32.         z += 1
  33. else:
  34.     z = z
  35.  
  36.  
  37. print(x, y, z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement