program fantscrin;
const n = 10;
var a: array [1..n] of integer;
i,min,max: integer;
begin
for i: =1 to n do
a[i]: = random(41)-20;
for i: =1 to n do
write(a[i], ' ');
min: =a[1];
for i: =1 to n do
if (a[i]< min) then min: =a[i];
max: =a[1];
for i: =1 to n do
if (a[i]> max) then max: =a[i];
writeln('');
writeln(min+max);
end.
Поделитесь своими знаниями, ответьте на вопрос:
'первая
clsscreen 12input "n"; ndim a(n)for i = 1 to n input a(i)nextsum = 0for i = 1 to n sum = sum + a(i)nextsrednee = sum / nprint sumprint srednee
'вторая
clsscreen 12input "n"; ndim a(n)for i = 1 to n input a(i)nextmax = 0for i = 1 to n if a(i) > max then max = a(i)nextprint max