Cod sursa(job #143330)

Utilizator andumMorie Daniel Alexandru andum Data 26 februarie 2008 12:33:35
Problema Algoritmul lui Euclid Scor 0
Compilator fpc Status done
Runda Arhiva educationala Marime 0.38 kb
var a,b,r:longint;   
    f,g:text;   
begin  
assign(f,'euclid2.in');   
assign(g,'euclid2.out');   
reset(f);   
rewrite(g);   
readln(f,a,b);   
r:=a mod b;   
while r<>0 do begin  
              a:=b;   
              b:=r;   
              r:=a mod b;   
              end;   
if b=1 then write(g,'0')   
       else write(g,b);   
close(f);   
close(g);   
end.