какой язык программирования ?
Если паскаль, то
Цитата:
program _numbs;
var
N, count :integer;
N_prev, exit_count :integer;
BEGIN
{input & process. }
while exit_count < 3 do
begin
Write('N: ');Readln(N);
if not (odd(N)) then inc(count);
if N=N_prev then inc(exit_count)
else exit_count:=1;
N_prev:=N;
end;
{ output }
write('количество четных: ',count);
END.
|