Pagini recente » Cod sursa (job #1606730) | Cod sursa (job #2094357) | Cod sursa (job #2147774) | Cod sursa (job #151633) | Cod sursa (job #115367)
Cod sursa(job #115367)
var a,b,x,y:longint;
f,g:text;
function cif(x:longint):boolean;
begin
cif:=true;
while x>9 do
begin
if (x mod 10>1) then
begin
cif:=false;
exit;
end;
x:=x div 10;
end;
if (x<>1) then cif:=false;
end;
function cmmmc(x,y:longint):longint;
var a:longint;
begin
a:=x;
while a mod y <>0 do a:=a+x;
cmmmc:=a;
end;
begin
assign(f,'multiplu.in'); reset(f);
assign(g,'multiplu.out'); rewrite(g);
readln(f,a,b);
x:=cmmmc(a,b);
y:=x;
while not cif(y) do y:=y+x;
writeln(g,y);
close(g);
end.