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 HOC24;
var i,d: integer;
a: array[1..6] of real;
begin
for i:=1 to 6 do
begin
write('Nhap diem cua ban thu ',i,': '); readln(a[i]);
end;
write('Diem trung binh tren 6.5 la: ');
for i:=1 to 6 do if a[i]>6.5 then write(a[i]:1:1,' ');
writeln;
d:=0;
for i:=1 to 6 do if a[i]<5 then d:=d+1;
write('Co ',d,' ban it hon 5 diem');
readln
end.
uses crt;
var a:array[1..6]of integer;
i,dem:integer;
begin
clrscr;
for i:=1 to 6 do
begin
write('Nhap diem cua ban thu ',i,' la: '); readln(a[i]);
end;
for i:=1 to 6 do
if a[i]>6.5 then write(a[i]:4);
writeln;
dem:=0;
for i:=1 to 6 do
if a[i]<5 then inc(dem);
writeln(dem);
readln;
end.
program bt;
uses crt;
var i, s, sa, sd, sc, sl, da, dd, dc, dl : integer;
a : array[1..50] of integer;
begin
clrscr;
for i:=1 to 10 do begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Day so vua nhap la: ');
for i:=1 to 10 do write(a[i],', ');
writeln;
s := 0; sa := 0; sd := 0; sc := 0; sl := 0; da := 0; dd := 0; dc := 0; dl := 0;
for i:=1 to 10 do begin
s := s + a[i];
if (a[i] > 0) then begin sd := sd + a[i]; dd := dd + 1 end;
if (a[i] < 0) then begin sa := sa + a[i]; da := da + 1 end;
if (a[i] mod 2 = 0) then begin sc := sc + a[i]; dc := dc + 1; end
else begin sl := sl + a[i]; dl := dl + 1 end;
end;
writeln('Tong cac phan tu trong mang la ',s);
writeln('Trung binh cong cac phan tu trong mang la ',s/10);
writeln('Tong cac so am la ',sa);
writeln('Tong cac so duong la ',sd);
writeln('Tong cac so chan la ',sc);
writeln('Tong cac so le la ',sl);
writeln('So cac so am la ', da);
writeln('So cac so duong la ', dd);
writeln('So cac so chan la ', dc);
writeln('So cac so le la ', dl);
readln
end.
uses crt;
var i,n:byte;Max:real;
a:array[1..50]of real;
begin
clrscr;
write('nhap so hoc sinh cua lop:');readln(n);
for i:=1 to n do
begin
write('nhap diem trung binh mon tin cho hoc sinh thu ',i,':');readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('diem trung binh mon tin cao nhat la: ',Max);
readln;
end.
uses crt;
var i,n:byte;Max:real;
a:array[1..50]of real;
begin
clrscr;
write('nhap so hoc sinh cua lop:');readln(n);
for i:=1 to n do
begin
write('nhap diem trung binh mon tin cho hoc sinh thu ',i,':');readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('diem trung binh mon tin cao nhat la: ',Max:0:1);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t1,t2,dem1,dem2:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day so vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
t1:=0;
dem1:=0;
t2:=0;
dem2:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then
begin
t1:=t1+a[i];
inc(dem1);
end
else begin
t2:=t2+a[i];
inc(dem2);
end;
end;
writeln('Trung binh cac so chan la: ',t1/dem1:4:2);
writeln('Trung binh cac so le la: ',t2/dem2:4:2);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
s:=1;
for i:=1 to n do
s:=s*a[i];
writeln('Tich la: ',s:0:0);
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Trung binh la: ',t/n:4:2);
readln;
end.
Program HOC24;
var d,i,n: integer;
t: real;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
d:=0; t:=0;
for i:=1 to n do
if a[i] mod 2=0 then
begin
d:=d+1;
t:=t+a[i];
end;
t:=t/d;
writeln('Co ',d,' so chan trong mang');
writeln('Trung binh cong cac phan tu chan la: ',t:2:5);
write('Cac phan tu trong day theo chieu doc: ');
for i:=1 to n do writeln(a[i]);
readln
end.
var a:array[1..1000] of integer;
i,n,d:integer;
s:longint;
tbc:real;
begin
write('n = ');readln(n);
For i:=1 to n do
begin
write('Nhap so thu ',i,' = ');readln(a[i]);
s:=s+a[i];
if a[i] mod 2 = 0 then d:=d+1;
end;
tbc:=s/n;
writel('Co ',d,' so chan');
write('Trung binh cong cua day so la ',tbc:10:2);
readln
end.
uses crt;
var a:array[1..6]of integer;
i,t:integer;
begin
clrscr;
for i:=1 to 6 do
begin
write('Nhap diem cua ban thu ',i,':'); readln(a[i]);
end;
t:=0;
for i:=1 to 6 do
t:=t+a[i];
writeln('Tong diem trung binh la: ',t);
writeln('Diem trung binh cua day la: ',t/6:4:2);
readln;
end.