Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. # program na hledání maxima z řady čísel
  2.  
  3. print("Zadávej přirozená čísla, vstup ukonči nulou.")
  4.  
  5. max = 0 # proměnná pro maximum
  6. n = int(input("n = ")) # načtení přiroz. čísla
  7. while (n!=0):
  8. if(n>max):
  9. max = n
  10. n = int(input("n = ")) # načtení dalšího n
  11. print("Maximum = ", max)
  12. input("Stiskni ENTER")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement