1.
uses math;
var
counterCh, counternCh, x : integer;
begin
counternCh := 0;
counterCh := 0;
readln(x);
x := abs(x);
while x > 0 do
if ((x mod 10) mod 2) = 0 then
counterCh := counterCh + 1
else
counternCh := counternCh + 1;
x := x div 10;
end;
writeln('Количество четных цифр: ', counterCh);
writeln('Количество нечётных цифр: ', counternCh);
end.
2.
i : integer;
for i := 1000 to 9999 do
if i mod 10 = 6 then
write(i, ' ');
1.
uses math;
var
counterCh, counternCh, x : integer;
begin
counternCh := 0;
counterCh := 0;
readln(x);
x := abs(x);
while x > 0 do
begin
if ((x mod 10) mod 2) = 0 then
counterCh := counterCh + 1
else
counternCh := counternCh + 1;
x := x div 10;
end;
writeln('Количество четных цифр: ', counterCh);
writeln('Количество нечётных цифр: ', counternCh);
end.
2.
var
i : integer;
begin
for i := 1000 to 9999 do
if i mod 10 = 6 then
write(i, ' ');
end.