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

Quelle  zahlenlotto.cob   Sprache: Cobol

 
       identification division.
       program-id. zahlenlotto.
      *  aus Pomberger, Dobler
      * Algorithmen und Datenstrukturen, p57 
       author"JD".
       date-written. 3.6.2008.
       date-compiled.
       data division.
       working-storage section.
       77 i   pic 9(4).
       77 n   pic 9(4).
       77 k   pic 9(4).
       77 nf    pic 9(4).
       77 kf    pic 9(4).
       77 nmkf  pic 9(4).
       77 bc   pic 9(4).
       procedure division.
      * computes something
         accept n
         accept k
      * n!  
         move 1 to nf
         perform varying i from 1 until i>n
           multiply nf by i
         end-perform
      * k!   
         move 1 to kf
         perform varying i from 1 until i>k
           multiply kf by i
         end-perform
      * (n-k)!   
         move 1 to nmkf
         perform varying i from 1 until i>n-k
           multiply nmkf by i
         end-perform
      * binomial coefficient 
         compute bc = nf / (kf * nmkf)
         display bc
        end-program fak.

Messung V0.5
C=83 H=89 G=85

¤ Dauer der Verarbeitung: 0.9 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 und die Messung sind noch experimentell.