Var a:array[1..100] of integer;
i,n,max,min:integer;
begin
writeln('Skolko elementov');
readln(n);
for i:=1 to n do begin write('a[',i,']='); read(a[i]); end;
max:=a[1]; min:=a[1];
for i:=1 to n do if a[i]>max then max:=a[i];
for i:=1 to n do if a[i]<min then min:=a[i];
writeln('Max - Min =' ,max-min);
<span>end.</span>
// PascalABC.NET
var
y,x,n:real;
begin
write('Введите n: ');
readln(n);
while (x <= n) do begin
writeln('Y = ', sin(x)*cos(x));
x:=x+0.1;
end;
end.
Проверка:
Введите n: 1
Y = 0
Y = 0.0993346653975306
Y = 0.194709171154325
Y = 0.282321236697518
Y = 0.358678045449761
Y = 0.420735492403948
Y = 0.466019542983613
Y = 0.49272486499423
Y = 0.499786801520753
Y = 0.486923815439098
Y = 0.454648713412841