Pagini recente » Cod sursa (job #1060331) | Cod sursa (job #2384) | Cod sursa (job #1710448) | Cod sursa (job #2227449) | Cod sursa (job #115004)
Cod sursa(job #115004)
var f,g:text;
q,w,min,max,aux,auxx:int64;
ok,ok1,ok2:boolean;
begin
assign (f,'multiplu.in');
assign (g,'multiplu.out');
reset(f);
rewrite (g);
readln (f,q,w);
aux:=0;
if q>w
then
begin
min:=w;
max:=q
end
else
begin
min:=q;
max:=w;
end;
ok:=true;
while ok do
begin
ok1:=true;
while ok1 do
begin
aux:=aux+max;
auxx:=aux;
ok2:=true;
while ok2 do
if (auxx mod 10=0) or (auxx mod 10=1)
then
begin
auxx:=auxx div 10;
if auxx=0
then
break;
end
else
ok2:=false;
if ok2
then
ok1:=false;
end;
if aux mod min=0
then
begin
writeln (g,aux);
ok:=false;
end;
end;
close(f);
close(g);
end.