products/sources/formale sprachen/Cobol/verschiedene-Autoren/Wirth image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: agev.cob   Sprache: Cobol

Original von: verschiedene©

       identification division.
       program-id. agev.
      *  aus Wirth, systematisches Programmieren p. 126 
       author"JD".
       date-written. 11.9.2005.
       date-compiled.
       data division.
       working-storage section.
         78 n   pic 9(4) value 100.
         77 i   pic 9(4).
         77 j   pic 9(4).
         77 k   pic 9(4).
         77 p   pic 9(4)V9(4).
         77 t   pic 9(4)V9(4).
       linkage section.
         01 array occurs n.
           05 a pic 9(4)V9(4) occurs n.
         77 b     pic 9(4)V9(4) occurs n.
         77 x     pic 9(4)V9(4) occurs n.
       procedure division using x array b.
      *  solve equation x = a * b for matrices
         perform varying k from 1 by 1 until k = n
           compute p = 1/a(k, k)
           perform varying j from k+1 until j = n
             multiply a(k, j) by p
           end-perform  
           multiply b(k) by p
           perform varying i from k+1 until i = n
             perform varying j from k+1 until j = n
               compute a(i,j) = a(i,j) - a(i,k)*a(k,j)
             end-perform  
             compute b(i) = b(i) - a(i,k)*b(k)
           end-perform
         end-perform
         move n to k
         perform until k = 0
           move b(k) to t
           perform varying j from k+1 until j = n
             compute t = t - a(k,j)*x(j)
           end-perform
           move t to x(k)
           subtract 1 from k
         end-perform.
      *  x(1) ... x(n) sind die Lösungen      
        end-program  agev.

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet)  ¤





Download des
Quellennavigators
Download des
sprechenden Kalenders

in der Quellcodebibliothek suchen




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.


Bot Zugriff