program phiasaumocogai;
var
n, i, num, min, max, sum: integer;
average: real;
begin
write('Nhap so luong day so can kiem tra: ');
readln(n);
min := maxint;
max := -maxint;
sum := 0;
for i := 1 to n do
begin
write('Nhap day so thu ', i, ': ');
readln(num);
if num < min then
min := num;
if num > max then
max := num;
sum := sum + num;
end;
average := sum / n;
writeln('So nho nhat la: ', min);
writeln('So lon nhat la: ', max);
writeln('Tong cac day so la: ', sum);
writeln('Trung binh cua cac so la: ', average:0:2);
end.
Đúng 1
Bình luận (0)