Составьте программу, которая последовательно запросит 10 целых чисел и в результате сообщит, сколько среди введенных чисел четных и сколько нечетных чисел.
Ответы на вопрос
Ответил estengseant
0
var q,w,e,r,t,y,u,i,o,p,l,s,a: Integer;
begin
writeln('Введите 10 целых чисел');
readln(q,w,e,r,t,y,u,i,o,p);
s:=0;
a:=0;
for l:=0 to 9 do
begin
if l=0 then if q mod 2=0 then s:=s+1 else a:=a+1;
if l=1 then if w mod 2=0 then s:=s+1 else a:=a+1;
if l=2 then if e mod 2=0 then s:=s+1 else a:=a+1;
if l=3 then if r mod 2=0 then s:=s+1 else a:=a+1;
if l=4 then if t mod 2=0 then s:=s+1 else a:=a+1;
if l=5 then if y mod 2=0 then s:=s+1 else a:=a+1;
if l=6 then if u mod 2=0 then s:=s+1 else a:=a+1;
if l=7 then if i mod 2=0 then s:=s+1 else a:=a+1;
if l=8 then if o mod 2=0 then s:=s+1 else a:=a+1;
if l=9 then if p mod 2=0 then s:=s+1 else a:=a+1;
end;
writeln('Чётных: ',s);
writeln('Нечётных: ',a);
end.
begin
writeln('Введите 10 целых чисел');
readln(q,w,e,r,t,y,u,i,o,p);
s:=0;
a:=0;
for l:=0 to 9 do
begin
if l=0 then if q mod 2=0 then s:=s+1 else a:=a+1;
if l=1 then if w mod 2=0 then s:=s+1 else a:=a+1;
if l=2 then if e mod 2=0 then s:=s+1 else a:=a+1;
if l=3 then if r mod 2=0 then s:=s+1 else a:=a+1;
if l=4 then if t mod 2=0 then s:=s+1 else a:=a+1;
if l=5 then if y mod 2=0 then s:=s+1 else a:=a+1;
if l=6 then if u mod 2=0 then s:=s+1 else a:=a+1;
if l=7 then if i mod 2=0 then s:=s+1 else a:=a+1;
if l=8 then if o mod 2=0 then s:=s+1 else a:=a+1;
if l=9 then if p mod 2=0 then s:=s+1 else a:=a+1;
end;
writeln('Чётных: ',s);
writeln('Нечётных: ',a);
end.
Ответил Аноним
0
"Аффигеть!" (с)
Ответил estengseant
0
Ждал ваш комментарий и долждался. Весело однако.
Ответил Аноним
0
А уж как мне весело! Это где так учат писать? Или просто чтобы постебаться?
Новые вопросы