|
|
back to boardWhat's wrong with my program var s:array[1..30] of byte; n,i,t:longint; begin read(n);i:=9;t:=31; if n=0 then begin writeln('10');halt;end else if n=1 then begin writeln('1');halt;end; while i<>1 do begin while n mod i=0 do begin dec(t); s[t]:=i; n:=n div i; end; dec(i); end; if n=1 then begin for i:=t to 30 do write(s[i]); writeln; end else writeln('?'); end. Re: What's wrong with my program I think you should output '-1' instead of '?' if the test has no solution. Good luck. Re: What's wrong with my program Thank you very much. |
|
|