Первое :
var
i, num, nums2, nums3, nums4, nums5: Integer;
begin
for i := 1 to 20 do
begin
ReadLn(num);
if num = 2 then
nums2 := nums2 + 1
else if num = 3 then
nums3 := nums3 + 1
else if num = 4 then
nums4 := nums4 + 1
else if num = 5 then
nums5 := nums5 + 1 ;
end;
WriteLn('Количество двоек - ', nums2);
WriteLn('Количество троек - ', nums3);
WriteLn('Количество четвёрок - ', nums4);
WriteLn('Количество пятёрок - ', nums5);
end.
Второе:
var
i, height, minHeight, maxHeight: Integer;
totalHeight: Real;
begin
for i := 1 to 20 do
begin
ReadLn(height);
if (i = 1) or (height < minHeight) then
minHeight := height ;
if (i = 1) or (height > maxHeight) then
maxHeight := height ;
totalHeight := totalHeight + height;
end;
WriteLn('Максимальный рост - ', maxHeight);
WriteLn('Минимальный рост - ', minHeight);
WriteLn('Средний рост - ', Round(totalHeight / 20.0))
end.
begin
write('Введите число А: ');
readln(a);
write('Введите число B: ');
readln(b);
write('Введите число C: ');
readln(c);
if (a >= 0) and (b >= 0) and (c >= 0) then rez := a + b + c;
if (a >= 0) and (b >= 0) then rez := a + b;
if (a >= 0) and (c >= 0) then rez := a + c;
if (b >= 0) and (c >= 0) then rez := b + c;
if (a <= 0) and (b <= 0) then rez := c;
if (b <= 0) and (c <= 0) then rez := a;
if (a <= 0) and (c <= 0) then rez := b;
if (a <= 0) and (b <= 0) and (c <= 0) then rez := 0;
writeln(rez);
end.
Громоздко, но, думаю, покатит