Pagini recente » Cod sursa (job #736854) | Cod sursa (job #1923950) | Diferente pentru problema/drum intre reviziile 29 si 9 | Cod sursa (job #1362634) | Cod sursa (job #871341)
Cod sursa(job #871341)
var a,b:longint;f,g:text;
Function c(a,b:longint):longint;
var aux:longint;
begin
while b<>0 do
Begin
aux:=a;
a:=b;
b:=aux mod b;
end;
c:=a;
end;
Begin
assign(f,'euclid2.in');reset(f);
assign(g,'euclid2.out');rewrite(g);
readln(f,a);
repeat
readln(f,a,b);
write(g,c(a,b),chr(10));
until eof(f);
close(f);
close(g);
end.