Pagini recente » Cod sursa (job #1284511) | Cod sursa (job #1975207) | Diferente pentru problema/scmax intre reviziile 36 si 35 | Cod sursa (job #909057) | Cod sursa (job #264594)
Cod sursa(job #264594)
var i,n,a,b:longint;
f,g:text;
function gcd(a,b:longint):longint;
begin
if b=0 then gcd:=a
else gcd:=gcd(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,gcd(a,b));
end;
close(f);
close(g);
end.