000100 IDENTIFICATION DIVISION.
000110 PROGRAM-ID. PRAC09.
000120 AUTHOR. LUIS CECILIANO.
000130 DATE-WRITTEN. DECEMBER 11, 2019.
000140*LEER TRES DATOS Y ORDENARLOS DE MENOR A MAYOR
000150 SECURITY. FOREVER.
000200 ENVIRONMENT DIVISION.
000250 DATA DIVISION.
000300 WORKING-STORAGE SECTION.
000310     01 WKS-ARREGLO.
000320         03 WKS-NUMS  PIC 9(02) OCCURS 3 TIMES.
000330     01 WKS-I    PIC 9(02).
000340     01 WKS-J    PIC 9(02).
000350     01 WKS-AUX  PIC 9(02).
000400 PROCEDURE DIVISION.
000500 0000-PRINCIPAL.
000600     DISPLAY "INTRODUCE TRES ENTEROS: "
000700     ACCEPT WKS-NUMS(1)
000800     ACCEPT WKS-NUMS(2)
000900     ACCEPT WKS-NUMS(3)
001000     MOVE 0 TO WKS-I
001100     PERFORM 1000-UN-DIGITO 3 TIMES
001200     PERFORM 2000-MUESTRA
001300     STOP RUN.
001400 1000-UN-DIGITO.
           ADD 1 TO WKS-I
           MOVE 0 TO WKS-J
           PERFORM 1500-COMPARA 2 TIMES.
       1500-COMPARA.
           ADD 1 TO WKS-J
           IF WKS-NUMS(WKS-J) > WKS-NUMS(WKS-J + 1)
               MOVE WKS-NUMS(WKS-J) TO WKS-AUX
               MOVE WKS-NUMS(WKS-J + 1) TO WKS-NUMS(WKS-J)
                  MOVE WKS-AUX TO WKS-NUMS(WKS-J + 1).
       2000-MUESTRA.
           DISPLAY "LOS NUMEROS ORDENADOS SON: "
           DISPLAY WKS-NUMS(1)
           DISPLAY WKS-NUMS(2)
           DISPLAY WKS-NUMS(3).
