Pagini recente » Diferente pentru utilizator/andrici_cezar intre reviziile 178 si 127 | Profil Ramona2007 | Diferente pentru stelele-2009/9-10/runda-2 intre reviziile 6 si 5 | Cod sursa (job #207714) | Cod sursa (job #156743)
Cod sursa(job #156743)
var i,n,a,b,r:longint;
f,g:text;
begin
assign(f,'euclid2.in'); reset(f);
assign(g,'euclid2.out'); rewrite(g);
readln(f,n);
for i := 1 to n do begin
readln(f,a,b);
r:=0;
while b<>0 do begin
r:=b mod a;
b:=a;
a:=r;
end;
writeln(g,a);
end;
close(f);
close(g);
end.