Pagini recente » Cod sursa (job #2250390) | Cod sursa (job #817654) | Cod sursa (job #1088124) | Cod sursa (job #1598156) | Cod sursa (job #956217)
Cod sursa(job #956217)
var buf1: array[1..1 shl 10] of char;
fi: text;
r, i, n, k, a, b:longint;
begin
assign(fi,'euclid2.in');
assign(output,'euclid2.out');
reset(fi);
rewrite(output);
settextbuf(fi,buf1);
readln(fi, n);
for k:=1 to n do
begin
readln(fi,a,b);
begin
repeat
r:=a mod b;
a:=b;
b:=r;
until r=0;
writeln(a);
end;
end;
close(fi);
close(output);
end.