Pagini recente » Cod sursa (job #2486009) | Cod sursa (job #1823236) | Cod sursa (job #1082366) | Diferente pentru template/preoni-2006/header intre reviziile 1 si 3 | Cod sursa (job #1184278)
program cmmdc;
var a,b:longword; i,n:longword; f,g:text;
function cm(a,b:longint):longint;
begin
if b=0 then cm:=a
else cm:=cm(b,a mod b);
end;
begin
assign(f,'euclid2.in'); reset(f);
assign(g,'euclid2.out'); rewrite(g);
readln(f,n);
for i:=1 to n do
begin
readln(f,a,b);
writeln(g,cm(a,b));
end;
close(f); close(g);
end.