c) Thông báo ra màn hình số học sinh cao hơn 1.6m
for i:= 1 to n do
if 1.6 < a[i] then dem := dem+1 ;
writeln('so hoc sinh cao hon 1.6m la : ',dem,' hoc sinh');
bạn có thể làm gộp 3 câu như này nè
uses crt;
var a : array[1..100] of real;
i, N, d : integer;
max: real;
begin
write('Nhap so hoc sinh = '); readln (N);
for i:= 1 to N do
begin
write('a[',i,']='); readln (a[i]);
end;
max := 0; d := 0;
for i:= 1 to n do
begin
if max < a[i] then max := a[i];
if 1.6 < a[i] then dem := dem+1 ;
end;
writeln('chieu cao lon nhat la : ',max);
writeln('so hoc sinh cao hon 1.6m la : ',dem,' hoc sinh');
readln;
end.
Chúc học tốt nhaa!