identificationdivision. program-id. ggt. * aus Wirth, systematisches Programmieren p. 46 author. "JD". date-written. 11.9.2005. date-compiled. datadivision. working-storagesection. 77 a pic9(4). 77 c pic9(4). 77 u pic9(4). 77 b pic9(4). 77 d pic9(4). 77 v pic9(4). 77 q pic9(4). 77 t pic9(4). linkagesection. 77 x pic9(4). 77 y pic9(4). 77 r pic9(4). proceduredivisionusing x y r. * computes ggt(x,y) move x to a. move0to c move1to u. move y to b. move1to d. move0to v. divide a by b giving q compute r = function mod(a, b) * invariant a = q * b + r performuntil r = 0 * ggt(x,y) = c*x + d*y move b to a move r to b move u to t move c to u compute c = t - q * c move v to t move d to v compute d = t - q * d divide a by b giving q compute r = function mod(a, b) end-perform. * rules * ggt(2*m,2*n) = 2 * ggt(m,n) * etc. end-program ggt.
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-09)
¤
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.