Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/Cobol/verschiedene-Autoren/Wirth/   (Columbo Version 0.7©)  Datei vom 4.1.2008 mit Größe 913 B image not shown  

Quelle  sort-array.cob   Sprache: Cobol

 
       identification division.
       program-id. sort-array.
      *  aus Wirth, systematisches Programmieren p. 84 
       author"JD".
       date-written. 11.9.2005.
       date-compiled.
       data division.
       working-storage section.
       78 n   pic 9(4) value 10.
       77 s   pic 9(4)V9(4).
       77 u   pic 9(4)V9(4).
       77 h   pic 9(4).
       77 j   pic 9(4).
       77 k   pic 9(4).
       linkage section.
       77 x   pic 9(4)V9(4) occurs n.
       procedure division using x.
      * sort array x
         perform varying h from 1 by 1 until h >=n - 1
           move h to j
           perform varying k from h+1 by 1 until k>=n
             if x(k) > x(j) then move k to j
           end-perform
           move x(h) to u
           move x(j) to x(h)
           move u to x(j)
         end-perform
         display "sorted"
      * now x is sorted
        end-program  sort-array.

92%


¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

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.