program TimSoLonNhatVaDemSoAm;
var
N, i, max, dem: integer;
a: array[1..100] of integer;
begin
writeln('Nhap so ptu cua day: ');
readln(N);
for i := 1 to N do
begin
write('Nhap ptu thu ', i, ': ');
readln(a[i]);
end;
max := a[1];
for i := 2 to N do
begin
if a[i] > max then
max := a[i];
end;
writeln('So lon nhat trong day la: ', max);
dem := 0;
for i := 1 to N do
begin
if a[i] < 0 then
dem := dem + 1;
end;
writeln('So ptu am trong day la: ', dem);
end.
Đúng 1
Bình luận (0)