|
|
вернуться в форумFilippov Nickolas SSAU#2's AC program is HERE! program productofdigits; var a:array[2..9] of word; n:longint; i,k:word; begin Readln(n); for i:=2 to 9 do a[i]:=0; if n=0 then write(10) else if n=1 then write(1) else begin for i:=9 downto 2 do while n mod i = 0 do begin n:=n div i; inc(a[i]); end; if n<>1 then write(-1) else for i:=2 to 9 do for k:=1 to a[i] do write(i); end; end. |
|
|