program chieucao;
uses crt;
var : do,n,i,max,min:integer;
a:array[1..100] of integer;
begin
clrscr;
write('Nhap so hoc sinh trong lop:');readln(n);
for i:=1 to n do begin
write('Nhap chieu cao cua hoc sinh thu ',i,':');readln(a[i]); end;
max:=a[1]; min:=a[1];
for i:=2 to n do begin
if a[i] > max then max:=a[i];
if a[i]<min then min :=a[i];
end;
do:=max-min;
writeln('Do chenh lech chieu cao cua ban cao nhat va thap nhat la:',do);
readln
end.