Pagini recente » Cod sursa (job #1316971) | Cod sursa (job #979735) | Cod sursa (job #873619) | Cod sursa (job #743658) | 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.