Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
program DiemTrungBinh;
var
diem: real;
i, n: integer;
begin
write('Nhap so luong ban trong lop: ');
readln(n);
for i := 1 to n do
begin
write('Nhap diem trung binh cua ban ', i, ': ');
readln(diem);
if diem >= 5 then
writeln('Diem trung binh cua ban ', i, ' la: ', diem:0:2);
end;
end.
program TongSoChanTrongDay;
var
n, i, tong: integer;
a: array[1..100] of integer;
begin
tong := 0;
write('Nhap so phan tu cua day: ');
readln(n);
for i := 1 to n do
begin
write('Nhap phan tu thu ', i, ': ');
readln(a[i]);
if a[i] mod 2 = 0 then
tong := tong + a[i];
end;
writeln('Tong cac phan tu chan trong day la: ', tong);
readln;
end.
program day_du_cau_lenh;
uses crt;
var i,n:integer;
a:array[1..100]of intrger;
begin
clrscr;
write('nhap so n:');readln(n);
i:=1;
while i<=n do
begin
write('nhap a[',i,']:');readln(a[i]);
i:=i+1;
end;
for i:=1 to n do
if a[i]>=0 then write(a[i]) else write('');
readln;
end.
program tim_dien_tich;
uses crt;
var a1,a2,b1,b2,x1,x2,i,dem:longint;
dtnn,dt1,dt2,dt3,dt4,dt5,dt6:real;
x3:array[1..1000]of longint;
dt:array[1..1000]of real;
begin
clrscr;
write('nhap chieu dai va chieu rong:');readln(a1,b1);
a2:=a1;b2:=b1;dt1:=a1*b1;dt2:=dt1/2;
x1:=0;i:=0;dem:=0;
writeln(dt2:5:1);
writeln(x1);
while x1<b1 do
begin
dt3:=a2*x1/2;
dt4:=(b2-x1)*x1/2;
dt5:=b2*(a2-x1)/2;
dt6:=dt1-dt3-dt4-dt5;
dt[i]:=dt6;x3[i]:=x1;
x1:=x1+1;i:=i+1;dem:=dem+1;
end;
dtnn:=dt[1];
for i:=1 to dem do
begin
if (dtnn>dt[i])and(dt[i]<>0) then dtnn:=dt[i];
end;
writeln(dtnn:5:1);
for i:=1 to dem do
if dtnn=dt[i] then writeln(x3[i]);
readln;
end.