Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/verschiedene-Autoren/Dahl/   (verschiedene Autoren Version 0.7©)  Datei vom 5.0.2009 mit Größe 1 kB image not shown  

SSL Dahl-p125.cbl   Sprache: Cobol

 

       identification division.
       program-id. dahl-p125.
      * aus O-J Dahl - Verifiable Programming
       author. Jens.
       date-written. 5.1.2009.
       date-compiled.
       data division.
       working-storage section.
       77 i     pic 9(4).
       77 j     pic 9(4).
       77 k     pic 9(4).
       77 te    pic 9(4).
       linkage section.
       77 n     pic 9(4).
       77 a     pic 9(4) occurs 100.
       77 b     pic 9(4) occurs 100.
       procedure division using n a b.
         perform varying i from 1 until i > n
           if i<=n then 
             move a(j) to a(i)
           else
             move j to b(i)
             move 1 to k
             perform until b(k) not= j add 1 to k end-perform
             move i to b(i)
             move k to b(k)
             move a(i) to te
             move j to b(te)
             if k=i then move j to a(i)
             else move k to a(i) end-if
           end-if
         end-perform
        end-program dahl-p125.

Messung
CHZG
909810096

¤ Dauer der Verarbeitung: 0.21 Sekunden  ¤

*© Formatika GbR, Deutschland