Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Lyx/src/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 25.0.1999 mit Größe 7 kB image not shown  

Quelle  stack.cob   Sprache: Cobol

 
       identification division.
       program-id. stack.
      * Autor JD
      * Dies ist ein Stack-Beispiel
      * analog Uni-Bremen, J. Quante
      * das 1. pop() ist undefiniert
       author"JD".
       date-written. 27.12.2006.
       date-compiled.
       data division.
       working-storage section.
         78 n         value 100.
         77 stack     pic 9(8) occurs n.
         77 stp       pic 9(8).
         77 item      pic 9(8).
       procedure division.
         display "start"
         perform newstack
         perform with test after
         until item=0
      *   some code
           perform pop
           display "Top of Stack is" item
         end-perform.
         display "done".
         stop run.
        newstack.
          move -1 to stp
        push.
          add 1 to stp
          if stp>n then display "Stacküberlauf" stop run end-if
          move item to stack(stp)
        pop.
          if stp<0 then display "Stackunterlauf" stop run end-if
          move stack(stp) to item
        tops.
          if stp<0 then move 0 to item
          else move stack(stp) to item
        end-program stack.

100%


¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Die farbliche Syntaxdarstellung ist noch experimentell.

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.