products/sources/formale Sprachen/Delphi/Agenda 1.1/Auslieferung/     Datei vom 4.1.2008 mit Größe 36 kB image not shown  

Quelle  pebbles.cob   Sprache: unbekannt

 
       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.

100%


[ zur Elbe Produktseite wechseln0.17Quellennavigators  Analyse erneut starten  ]