Pagini recente » Istoria paginii runda/procopiu_9_oji2015 | Cod sursa (job #276046) | Cod sursa (job #2683040) | Cod sursa (job #428844) | Cod sursa (job #624976)
Cod sursa(job #624976)
var f,g:text;
t,a,b,i:longint;
function euclid(x,y:longint):integer;
begin
if x- y=0 then writeln(g,x)
else if x>y then euclid(x-y,y)
else euclid(x,y-x);
end;
begin
assign(f,'euclid2.in'); reset(f);
assign(g,'euclid2.out'); rewrite(g);
read(f,t);
for i:=1 to t do
begin read(f,a,b); euclid(a,b); end;
close(f); close(g);
end.