|
|
вернуться в форумWrong answer... Послано Cross 29 янв 2011 12:19 program Project1; {$APPTYPE CONSOLE} uses SysUtils; var N,i,p,y:integer; temp:string; begin read(N); y:=1; for i:= N to 10000000 do begin temp:=IntToStr(i); for p:=1 to length(temp) do begin y:=y*StrToInt(temp[p]); if(y = N)and(i<>0) then begin writeln(i); exit; end; end; y:=1; end; writeln('-1'); end. Edited by author 29.01.2011 12:25 |
|
|