var s :string;i, j, dva, otv :integer;
beginwrite (‘vvedite dvoichnoe chislo = ’);readln (s);for i := 1 to length(s) doif strtoint (s[i]) > 0 thenbegindva:= 1;for j:= 1 to length(s)-i dodva:=dva*2;otv:=otv+dva;end;writeln(otv);readln;end.
var s :string;
i, j, dva, otv :integer;
begin
write (‘vvedite dvoichnoe chislo = ’);
readln (s);
for i := 1 to length(s) do
if strtoint (s[i]) > 0 then
begin
dva:= 1;
for j:= 1 to length(s)-i do
dva:=dva*2;
otv:=otv+dva;
end;
writeln(otv);
readln;
end.