Leer 5 números elimine el mayor y el menor y promedie los 3 restantes

Leer 5 números del teclado, elimine el mayor y el menor y promedie los 3 restantes en pseint

Como ya es costumbre, les comparto la solución de este algoritmo.

Algoritmo detarea

                Definir i,n,a,b,c,d,f,e Como Entero

                para i = 1 Hasta 5 Con Paso 1 Hacer

                               Escribir «Ingresa un numero»

                               leer n

                               si i == 1 Entonces

                                               a = n

                               FinSi

                               si i == 2 Entonces

                                               si n > a Entonces

                                                               b = a

                                                               a = n

                                               SiNo

                                                               b = n

                                               FinSi

                               FinSi

                               si i == 3 Entonces

                                               si n > a Entonces

                                                               c = b

                                                               b = a

                                                               a = n

                                               SiNo

                                                               si n > b Entonces

                                                                              c = b

                                                                              b = n

                                                               SiNo

                                                                              c = n

                                                               FinSi

                                               FinSi

                               FinSi

                               si i == 4 Entonces

                                               si n > a Entonces

                                                               d = c

                                                               c = b

                                                               b = a

                                                               a = n

                                               SiNo

                                                               si n > b Entonces

                                                                              d = c

                                                                              c = b

                                                                              b = n

                                                               SiNo

                                                                              si n > c Entonces

                                                                                              d = c

                                                                                              c = n

                                                                              SiNo

                                                                                              d = n

                                                                              FinSi

                                                               FinSi

                                               FinSi

                               FinSi

                               si i == 5 Entonces

                                               si n > a Entonces

                                                               e = d

                                                               d = c

                                                               c = b

                                                               b = a

                                                               a = n

                                               SiNo

                                                               si n > b Entonces

                                                                              e = d

                                                                              d = c

                                                                              c = b

                                                                              b = n

                                                               SiNo

                                                                              si n > c Entonces

                                                                                              e = d

                                                                                              d = c

                                                                                              c = n

                                                                              SiNo

                                                                                              si n > d Entonces

                                                                                                              e = d

                                                                                                              d = n

                                                                                              SiNo

                                                                                                              e = n

                                                                                              FinSi

                                                                              FinSi

                                                               FinSi

                                               FinSi

                               FinSi

                FinPara

                Escribir «El numero mayor es: «,a

                Escribir «El numero menor es: «,e

                Escribir «El promedio de «,b,»,»,c,»,»,d,» = «,(b+c+d)/3

FinAlgoritmo

Aquí puedes ver el funcionamiento de este código.

Leer 5 números del teclado elimine el mayor y el menor y promedie los 3 restantes
Leer 5 números del teclado elimine el mayor y el menor y promedie los 3 restantes
Descargar Programa

Bien amigos esta es la solución de este algoritmo, les comparto el código, espero les guste y mas que nada que les pueda ser de utilidad, un saludo y nos vemos en la próxima entrega.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *