|
|
вернуться в форумWhy WA!!! Please Help!! Program included! CONST max = 50; VAR Dig : ARRAY[1..max] OF Byte; N : LongInt; FUNCTION Solve(N : LongInt) : String; VAR L, I : Byte; Res : String; BEGIN L := 0; FOR I := 9 DOWNTO 2 DO BEGIN WHILE (N MOD I = 0) DO BEGIN N := N DIV I; Inc(L); Dig[L] := I; END; END; IF N <> 1 THEN Solve := '-1' ELSE BEGIN Res := ''; FOR I := L DOWNTO 1 DO Res := Res+Chr(Dig[I]+$30); Solve := Res; END; END; BEGIN Read(N); IF N < 0 THEN Write('-1') ELSE IF N = 0 THEN Write('10') ELSE Write(Solve(N)); END. Doesn't matter! I've solve it! Re: send me the solution > > |
|
|