pascal问题!急!
发布网友
发布时间:2023-10-09 09:12
我来回答
共1个回答
热心网友
时间:2023-11-07 03:57
一:
program aaa;
var
a,n,i,max,min:longint;
begin
readln(n);
for i:=1 to n do
begin
read(a);
if a>max then max:=a;
if a<min then min:=a;
end;
writeln(max,' ',min);
readln;
readln;
end.
二:
program aaa;
var
a:array[1..10]of longint;
n,i,j,t,v:longint;
ans:real;
begin
readln(n);
for i:=1 to n do
begin
read(a[i]);
end;
for i:=1 to n-1 do
for j:=i to n do
if a[i]>a[j] then
begin
t:=a[i];
a[i]:=a[j];
a[j]:=t;
end;
for i:=2 to n-1 do
v:=v+a[i];
ans:=v/(n-2);
writeln(ans:0:2);
readln;
readln;
end.