Введите с клавиатуры 8 положительных целых чисел. определите, сколько из них делятся на 3 и при этом заканчиваются на 4. программа должна вывести одно число: количество чисел, кратных 3 и оканчивающихся на 4.
Var b,I:integer; a:array [1..8] of integer; begin writeln('введите числа'); for I:=1 to 8 do read(a[I]); b:=0; for I:=1 to 8 do if (a[I]mod3=0) and (a[I]mod10=4) then b:=b+1; writeln(b); readln; end.
Var a1,a2,a3,a4,a5,a6,a7,a8,k:integer; begin k:=0; read (a1,a2,a3,a4,a5,a6,a7,a8); if (a1>0) and (a2>0) and (a3>0) and (a4>0) and (a5>0) and (a6>0) and (a7>0) and (a8>0) then begin if (a1 mod 3 = 0) and (a1 mod 10 = 4) then k:=k+1; if (a2 mod 3 = 0) and (a2 mod 10 = 4) then k:=k+1; if (a3 mod 3 = 0) and (a3 mod 10 = 4) then k:=k+1; if (a4 mod 3 = 0) and (a4 mod 10 = 4) then k:=k+1; if (a5 mod 3 = 0) and (a5 mod 10 = 4) then k:=k+1; if (a6 mod 3 = 0) and (a6 mod 10 = 4) then k:=k+1; if (a7 mod 3 = 0) and (a7 mod 10 = 4) then k:=k+1; if (a8 mod 3 = 0) and (a8 mod 10 = 4) then k:=k+1; writeln (k); end else writeln ('Неверный ввод'); end.
a:array [1..8] of integer;
begin
writeln('введите числа');
for I:=1 to 8 do
read(a[I]);
b:=0;
for I:=1 to 8 do
if (a[I]mod3=0) and
(a[I]mod10=4) then
b:=b+1;
writeln(b);
readln;
end.
begin
k:=0;
read (a1,a2,a3,a4,a5,a6,a7,a8);
if (a1>0) and (a2>0) and (a3>0) and (a4>0) and (a5>0) and (a6>0) and (a7>0) and (a8>0) then
begin
if (a1 mod 3 = 0) and (a1 mod 10 = 4) then k:=k+1;
if (a2 mod 3 = 0) and (a2 mod 10 = 4) then k:=k+1;
if (a3 mod 3 = 0) and (a3 mod 10 = 4) then k:=k+1;
if (a4 mod 3 = 0) and (a4 mod 10 = 4) then k:=k+1;
if (a5 mod 3 = 0) and (a5 mod 10 = 4) then k:=k+1;
if (a6 mod 3 = 0) and (a6 mod 10 = 4) then k:=k+1;
if (a7 mod 3 = 0) and (a7 mod 10 = 4) then k:=k+1;
if (a8 mod 3 = 0) and (a8 mod 10 = 4) then k:=k+1;
writeln (k);
end else
writeln ('Неверный ввод');
end.