Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Delphi/Bille 0.71/__history/     Datei vom 9.0.2013 mit Größe 18 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-written. 22.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
CHZG
1009910099

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland