Pagini recente » Cod sursa (job #1863986) | Cod sursa (job #613559) | Cod sursa (job #412178) | Cod sursa (job #2692794) | Cod sursa (job #513339)
Cod sursa(job #513339)
function euclid(a,b:longword):longword;
var r:longword;
begin
repeat
r:=a mod b;
a:=b;
b:=r;
until r=0;
euclid:=a;
end;
var be,ki:text;
a,b,i,n:longword;
begin
assign(be,'euclid2.in');
assign(ki,'euclid2.out');
reset(be);
rewrite(ki);
readln(be,n);
for i:=1 to n do
begin
readln(be,a,b);
writeln(ki,euclid(a,b));
end;
close(ki);
end.