Pagini recente » Diferente pentru blog/human-computation intre reviziile 2 si 1 | Cod sursa (job #1747857) | Cod sursa (job #3246219) | Diferente pentru agm2016/probleme intre reviziile 4 si 3 | Cod sursa (job #1067228)
Program euclid2;
var a,b,r : int64;
i,t :longint;
begin
assign(input,'euclid2.in'); reset(input);
assign(output,'euclid2.out'); rewrite(output);
readln(T);
for i:=1 to T do begin read (a,b);
while b<>0 do begin
r:=a mod b;
a:=b;
b:=r;
end;
writeln(a);
end;
close(input); close(output);
end.