Advertisement
diegokr

Máximos y Mínimos - Ejercicio 2

Nov 13th, 2019
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #Declaración de variables
  2. temp=-1
  3. maximo=0
  4. minimo=0
  5.  
  6. #Programa Principal
  7. while temp!=1000:
  8.  
  9.    #Ingreso de datos
  10.    temp=int(input("Ingrese una temperatura\n"))
  11.  
  12.    #Determino el máximo
  13.    if temp != 1000:
  14.       if temp > maximo:
  15.          maximo=temp
  16.  
  17.    #Determino el mínimo
  18.    if temp < minimo:
  19.       minimo=temp
  20.  
  21. #Salida por pantalla
  22. print("El máximo es:",maximo)
  23. print("El mínimo es:",minimo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement