Pagini recente » Cod sursa (job #564708) | Cod sursa (job #787760) | Cod sursa (job #3271548) | Cod sursa (job #2698054) | Cod sursa (job #741253)
Cod sursa(job #741253)
var x,y,n,i,t:longint;
BEGIN
assign(input,'euclid2.in');
reset(input);
readln(n);
assign(output,'euclid2.out');
rewrite(output);
for i:=1 to n do
begin
readln(x,y);
while y<>0 do
begin
t:=y;
y:=x mod y;
x:=t;
end;
writeln(x);
end;
{for i:=1 to n do
begin
readln(x,y);
while x<>y do
if x>y
then
x:=x-y
else
y:=y-x;
writeln(x);
end; }
Close(input);
Close(output);
END.