Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- * PROGRAMA QUE CALCULA LA SUCESIÓN DE PADOVAN. CALCULA SIN *
- * PROBLEMAS HASTA EL 306. PUEDE QUE PARA NÚMEROS MÁS GRANDES *
- * SE TENGA QUE UTILIZAR OTRO COMPILADOR DISTINTO A GNUCOBOL. *
- * LICENCIADO BAJO GNU GENERAL PUBLIC LICENCE (GNU GPL) 3.0 *
- ******** ******** F v q _ U k r a N a z i s ******* ********
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- IDENTIFICATION DIVISION.
- PROGRAM-ID. XBZ0-PAD.
- AUTHOR JESUS GUSTAVO VARGAS PEREZ (XEBUZER0).
- INSTALLATION EN TU KORA :V .
- DATE-WRITTEN 21-DICIEMBRE-2019.
- DATE-COMPILED 21-DICIEMBRE-2019.
- REMARKS Al chile soy la mera v3rdur4 put05.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- ENVIRONMENT DIVISION.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- DATA DIVISION.
- WORKING-STORAGE SECTION.
- 01 WS-TIMES PIC 9(38) VALUE 1.
- 01 WS-ACUM PIC 9(38) VALUE 1.
- 01 WS-CONT PIC 9(38) VALUE 1.
- 01 PADONUMS.
- 02 PADOPRIM PIC 9(38) VALUE ZEROS.
- 02 PADOSEGU PIC 9(38) VALUE 1.
- 02 PADOTERC PIC 9(38) VALUE 1.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- PROCEDURE DIVISION.
- 000-PRINCIPAL.
- PERFORM 100-LEER-NUM.
- PERFORM 200-PADOVAN.
- PERFORM 300-SALIR.
- 000-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- 005-SANITIZAR.
- IF WS-TIMES < 0 THEN
- MULTIPLY WS-TIMES BY -1 GIVING WS-TIMES.
- 005-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- 100-LEER-NUM.
- DISPLAY "INGRESE NÚMERO NATURAL".
- ACCEPT WS-TIMES.
- 005-SANITIZAR.
- 100-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- 200-PADOVAN.
- PERFORM 250-PADOCICLO
- VARYING WS-CONT FROM 1 BY 1
- UNTIL WS-CONT = WS-TIMES.
- DISPLAY "EL NÚMERO DE PADOVAN ES: " WS-ACUM.
- 200-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- 250-PADOCICLO.
- ADD PADOPRIM TO PADOSEGU GIVING WS-ACUM.
- MOVE PADOSEGU TO PADOPRIM.
- MOVE PADOTERC TO PADOSEGU.
- MOVE WS-ACUM TO PADOTERC.
- 250-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
- 300-SALIR.
- STOP RUN.
- 300-EXIT.
- EXIT.
- ***C**** ***O**** ***M**** ***M**** ***E**** ***N**** ***T****
Add Comment
Please, Sign In to add comment