Algoritmo dfd

5
Algoritmo Pablo Villamar_E5

Transcript of Algoritmo dfd

Page 1: Algoritmo dfd

Algoritmo

Pablo Villamar_E5

Page 2: Algoritmo dfd

3.- Crea un algoritmo q muestre en forma ordenada decrecientemente 5 números enteros ingresados desde el teclado

Page 3: Algoritmo dfd

Include <stdio.h> Int a,b,c,d,e Void main() { Printf(“ingrese la de números”); Scanf(“ %d,%d,%d,%d,%d”,&a,&b,&c,&d,&e); If (a>b&&b>c&&c>d&&d>e)) { Printf(“%d”,a,b,c,d,e); } If (b>a&&a>c&&c>d&&d>e) { Printf(“%d,%d,%d,%d,%d”,b,a,c,d,e); } If (c>a&&a>b&&b>d&&d>e) { Printf(“%d,%d,%d,%d,%d”,c,a,b,d,e); } If (d>a&&a>b&&b>c&&c>e) { Printf(“%d,%d,%d,%d,%d”,d,a,b,c,e); }

Page 4: Algoritmo dfd

If (e>a&&a>b&&b>c&&c>d) { Printf(“%d,%d,%d,%d,%d”,e,a,b,c,d); } If (e>d&&d>c&&c>b&&b>a) { Printf(“%d,%d,%d,%d,%d”,e,d,c,b,a); } If (d>e&&e>c&&c>b&&b>a) { Printf(“%d,%d,%d,%d,%d”,d,e,c,b,a); } If (e>a&&a>b&&b>c&&c>d) { Printf(“%d,%d,%d,%d,%d”,e,a,b,c,d); } If (c>e&&e>d&&d>b&&b>a) { Printf(“%d,%d,%d,%d,%d”,c,e,d,b,a); } Y así sucesivamente siguiendo la secuencia de orden Después (printf(“fin del programa”); fin

Page 5: Algoritmo dfd

INICIO

a,b,c,d,e (enteros)

Escribir (“ingrese loa numeros”);

Leer a,b,c,d,e

Si

En esta parte damos nosotros el orden que queremos tener debido a que no podemos usar punteros

Imprimimos por el cual condicionamos el si para el orden requerido