var x,s:integer; begin read(x); s := 0; while x > 0 do begin if x mod 10 < 6 then s := s + 1; {здесь была ошибка} x := x div 10 end; write(s) end.
2.
var x,s:integer; begin read(x); s := x mod 10; while x > 10 do x := x div 10; write(x + s) end.
3.
var x,a,b:integer; begin read(x); a := x mod 10; b := x mod 10; while x > 0 do begin if x mod 10 > a then a := x mod 10; if x mod 10 < b then b := x mod 10; x := x div 10; end; write(a + b) end.
Answers & Comments
Verified answer
1.var x,s:integer;
begin
read(x);
s := 0;
while x > 0 do
begin
if x mod 10 < 6 then s := s + 1; {здесь была ошибка}
x := x div 10
end;
write(s)
end.
2.
var x,s:integer;
begin
read(x);
s := x mod 10;
while x > 10 do
x := x div 10;
write(x + s)
end.
3.
var x,a,b:integer;
begin
read(x);
a := x mod 10;
b := x mod 10;
while x > 0 do
begin
if x mod 10 > a then a := x mod 10;
if x mod 10 < b then b := x mod 10;
x := x div 10;
end;
write(a + b)
end.