Advertisement
Spocoman

06. Max Number

Dec 27th, 2021 (edited)
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import sys
  2.  
  3. command = input()
  4. max_num = - sys.maxsize - 1
  5.  
  6. while command != 'Stop':
  7.     current = int(command)
  8.     if current > max_num:
  9.         max_num = current
  10.     command = input()
  11.  
  12. print(max_num)
  13.  
  14. Решение с масив:
  15.  
  16. numbers = []
  17. command = input()
  18.  
  19. while command != 'Stop':
  20.     numbers.append(int(command))
  21.     command = input()
  22.  
  23. print(max(numbers))
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement