Pagini recente » Diferente pentru problema/cuba intre reviziile 32 si 18 | Diferente pentru problema/arcas intre reviziile 45 si 20 | Rating Bere Ion (erebul) | Cod sursa (job #3194866) | Cod sursa (job #1131888)
Program euclid2;
var a,b,r : int64;
t,i : longint;
begin
assign(input,'euclid2.in'); reset(input);
assign(output,'euclid2.out'); rewrite(output);
readln(t);
for i:=1 to t do begin readln(a,b);
while a mod b<>0 do begin
r:=b;
b:=a;
a:=r mod a;
end;
writeln(b);
end;
close(input); close(output);
end.