DataMuseum.dk

Presents historical artifacts from the history of:

MIKADOS

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about MIKADOS

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦a1ab8436f⟧

    Length: 2528 (0x9e0)
    Notes: Mikados TextFile, Mikados_K
    Names: »RECURSIV«

Derivation

└─⟦89d8689a3⟧ Bits:30003591 MIKADOS Pascal compiler (01.02.1982 E)
    └─ ⟦this⟧ »RECURSIV« 

Text

PROGRAM RECURSIVEGCD;
 
FUNCTION GCD( M, N: INTEGER): INTEGER;
BEGIN
  IF N=0 THEN
    GCD := M
  ELSE
    GCD := GCD( N, M MOD N);
END;
 
PROCEDURE TRY( A, B: INTEGER);
BEGIN
  WRITELN( A:7, B:7, GCD(A,B):7  );
END;
 
BEGIN
  TRY( 18, 27 );
  TRY( 312, 2142 );
  TRY( 61, 53 );
  TRY( 98, 868 );
END.