Cod sursa(job #287085)
Utilizator | pop darius darius96 | Data | 24 martie 2009 15:53:03 |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
var a,b,i,j,k:longint;
v1,v2:array[1..1000]of integer;
begin
assign(input,'euclid2.in');reset(input);
assign(output,'euclid2.out');rewrite(output);
readln(t);
for i:= 1 to t do
readln(a,b);
for j:=1 to a do
if a mod j=0 then v1[j]:=j;
for k:=1 to b do
if b mod k=0 then v2[k]:=k;
if v1[j]=v2[k] then write(j);
close(input);close(output);
end.