|
|
back to boardCommon BoardSerious Complie Error !!! I don't know reason, please help me ! var m:array [1..30] of byte; n,k,l:longint; procedure find(num:longint;pos,last:byte); var t:byte; ok:boolean; begin if pos>k then begin if num=1 then begin for k:=1 to pos-1 do write(m[k]); halt; end; end else begin for t:=last to 9 do if num mod t=0 then begin m[pos]:=t; ok:=true; find(num div t,pos+1,t); end; end; end; begin readln(n); if n<=9 then begin writeln(n); halt; end; k:=n; repeat k:=k div 2; l:=l+1; until k=1; k:=0; repeat k:=k+1; find(n,1,2); until k=l; writeln(-1); end. Re: Serious you don't know the reason but .. hey, i don't know the task!!! This may be one of these i haven't solved, tell me its number ;-)) > Complie Error !!! I don't know reason, please help me ! > var m:array [1..30] of byte; > n,k,l:longint; > > procedure find(num:longint;pos,last:byte); > var t:byte; > ok:boolean; > begin > if pos>k then > begin > if num=1 then > begin > for k:=1 to pos-1 do write(m[k]); > halt; > end; > end > else > begin > for t:=last to 9 do > if num mod t=0 then > begin > m[pos]:=t; > ok:=true; > find(num div t,pos+1,t); > end; > end; > end; > > begin > readln(n); > if n<=9 then > begin > writeln(n); > halt; > end; > k:=n; > repeat > k:=k div 2; > l:=l+1; > until k=1; > > k:=0; > repeat > k:=k+1; > find(n,1,2); > until k=l; > writeln(-1); > end. Re: Serious When you submit your program mark "To this E-Mail address" and write down your e-mail address. The server will send you info why the hell you prog is not compiling. > Complie Error !!! I don't know reason, please help me ! > var m:array [1..30] of byte; > n,k,l:longint; > > procedure find(num:longint;pos,last:byte); > var t:byte; > ok:boolean; > begin > if pos>k then > begin > if num=1 then > begin > for k:=1 to pos-1 do write(m[k]); > halt; > end; > end > else > begin > for t:=last to 9 do > if num mod t=0 then > begin > m[pos]:=t; > ok:=true; > find(num div t,pos+1,t); > end; > end; > end; > > begin > readln(n); > if n<=9 then > begin > writeln(n); > halt; > end; > k:=n; > repeat > k:=k div 2; > l:=l+1; > until k=1; > > k:=0; > repeat > k:=k+1; > find(n,1,2); > until k=l; > writeln(-1); > end. |
|
|