Код
Program perevod;
uses crt;
var a,err:integer;
d,i:byte;
mas:array [0..10] of shortint;
ok,f,g:boolean;
s:string;
k:longint;
Begin
clrscr;
repeat
writeln ('Vvedite chislo: Exit - press 0'); readln (s);
ok:=(ioresult=0); val (s,k,err);
ok:= ok and (err=0) and (length(s)<11) and ((k>=-99999999) and (k<=9999999));
if not ok then writeln ('error!!!');
until ok;
repeat
readln(a);
if (a<0) then g:=false
else g:=true;
d:=0;
if (a=0) then halt;
repeat
i:=0;
dec(a);
repeat
f:=true;
inc(mas[i]);
if (mas[i]=2) then
begin
mas[i]:=-1;
inc(i);
if (d<i) then d:=i;
f:=false;
end;
until f;
until (a=0);
for i:=d downto 0 do
begin
if g then write(mas[i]) else write(-mas[i]);
mas[i]:=0;
end;
writeln;
until (1<>1);
end.
Вот так, как я понял... но первый цикл кончается и начинается следующий, который уже выполняет дальнейшие действия (readln(a) - считывается уже другое число, а не то, которое проверялось)... Ввожу "45" - пустая строка, ввожу 45 - 1-1-100 ...
