Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


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.

Messung
CHZG
9010010096

¤ Dauer der Verarbeitung: 0.4 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,835
#Domains=906,746