var
n, max, count, contrl, max2: integer;
begin
contrl := 0;
max := 0;
Writeln('Введите числа: ');
Readln(n);
while n <> 0 do
begin
Inc(count);
if n>max then begin max2:=max; max:=n end
else if n > max2 then max2 := n;
Read(n);
end;
max2*=max;
Writeln('Введите контрольное значение: ');
Read(contrl);
Writeln('Получено: ', count, ' чисел');
Writeln('Получено контрольное значение: ', contrl);
Writeln('Вычисленное контрольное значение:: ', max2);
if contrl = max then Writeln('Контроль пройден')
else Writeln('Контроль не пройден');
end.
var
n, max, count, contrl: integer;
begin
contrl := 0;
max := 0;
Writeln('Введите числа: ');
Readln(n);
while n <> 0 do
begin
Inc(count);
if (n mod 10 = 0) and (n > max) then max := n;
Read(n);
end;
Writeln('Введите контрольное значение: ');
Read(contrl);
Writeln('Получено: ', count, ' чисел');
Writeln('Получено контрольное значение: ', contrl);
Writeln('Вичисленное контрольное значение:: ', max);
if contrl = max then Writeln('Контроль пройден')
else Writeln('Контроль не пройден');
end.
begin
var a:=ArrRandom(35,50,350); a.Println;
Writeln('k=',a.Where(x->(x mod 3=0) and (x mod 10<>2)).Count)
end.
Тестовое решение:
74 243 74 138 215 124 247 255 112 171 71 246 216 346 125 318 251 312 217 58 146 150 202 279 75 121 210 297 129 280 122 234 185 296 307
k=14