products/Sources/formale Sprachen/C/Linux/block/   (NIST Cobol Test-Suite ©)  Datei vom 24.10.2025 mit Größe 32 kB image not shown  

Quelle  pebbles.cob

  Sprache: Cobol
 

       identification division.
       program-id. pebbles.
       author"Reisig/ PN Newsletter 10-05 p. 3".
      *         ursprünglich von E. W. Diijkstra
       date-written22.11.2005.
       date-compiled.
       data division.
       working-storage section.
       77 b pic 9(4).
       77 w pic 9(4).
       linkage section.
       77 BB  pic 9(4).
       77 WW  pic 9(4).
       procedure division using BB WW.
      * computes solutions for the pebble game
         move BB to b
         move WW to w
         perform until false
           if w>=1 and b>=1
             subtract 1 from b
           else if b>=2 then
             subtract 1 from b
           else if w>=2 then
             subtract 2 from w
             add 1 to b
           end-if end-if end-if
         end-perform.
         display "b="b" w="w.
        end-program pebbles.

Messung V0.5 in Prozent
C=94 H=100 G=96

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-14) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.