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

⟦5ab05099d⟧

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

Derivation

└─⟦ca21ef4c0⟧ Bits:30005311 Extended Pascal System Disc v. 04.07.1980 (SPC/1)
    └─ ⟦this⟧ »RECURSIV« 

Text

(*D+*)
PROGRAM RECURSIVEGCD;
 
VAR X,Y,N: INTEGER;
 
FUNCTION GCD( M, N: INTEGER): INTEGER;
BEGIN IF N=0 THEN GCD := M
      ELSE GCD := GCD( N, M MOD N)
END (* OF GCD*);
 
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.