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.
Theo em, với công cụ truy vấn ta có được dữ liệu trình bày được như Hình 4.
uses crt;
var a:array[1..100]of integer;
i,n,tb:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
tb:=0;
i:=1;
while i<=n do
begin
tb:=tb+a[i];
inc(i);
end;
writeln(tb/n:4:2);
readln;
end.
program diem_thi;
uses crt;
var dt: real;
begin
clrscr;
writeln(' nhap diem thi:'); readln(dt);
if dt=>8 then writeln('loai gioi:');
if (6.5 <= dt) and (dt<8.0) writeln(' loai kha:');
if (5<=dt) and (dt<6,5) then writeln(' loai trung binh:');
if dt<5 then writeln('loai ken:');
readln;
end.
const fi='diem.txt';
fo='kq.txt';
var f1,f2:text;
hs1,hs2,hs3:array[1..100]of integer;
dem1,dem2,dem3,t1,t2,t3,i,sc:integer;
kq:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
dem1:=0;
while not eoln(f1) do
begin
inc(dem1);
read(f1,hs1[dem1]);
end;
readln(f1);
dem2:=0;
while not eoln(f1) do
begin
inc(dem2);
read(f1,hs2[dem2]);
end;
readln(f1);
dem3:=0;
while not eoln(f1) do
begin
inc(dem3);
read(f1,hs3[dem3]);
end;
t1:=0;
for i:=1 to dem1 do
t1:=t1+hs1[i];
t2:=0;
for i:=1 to dem2 do
t2:=t2+(2*hs2[i]);
t3:=0;
for i:=1 to dem3 do
t3:=t3+(3*hs3[i]);
sc:=dem1+dem2*2+dem3*3;
kq:=(t1+t2+t3)/sc;
writeln(f2,kq:4:1);
close(f1);
close(f2);
end.
const fi='diem.txt';
fo='kq.txt';
var f1,f2:text;
hs1,hs2,hs3:array[1..100]of integer;
dem1,dem2,dem3,t1,t2,t3,i,sc:integer;
kq:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
dem1:=0;
while not eoln(f1) do
begin
inc(dem1);
read(f1,hs1[dem1]);
end;
readln(f1);
dem2:=0;
while not eoln(f1) do
begin
inc(dem2);
read(f1,hs2[dem2]);
end;
readln(f1);
dem3:=0;
while not eoln(f1) do
begin
inc(dem3);
read(f1,hs3[dem3]);
end;
t1:=0;
for i:=1 to dem1 do
t1:=t1+hs1[i];
t2:=0;
for i:=1 to dem2 do
t2:=t2+(2*hs2[i]);
t3:=0;
for i:=1 to dem3 do
t3:=t3+(3*hs3[i]);
sc:=dem1+dem2*2+dem3*3;
kq:=(t1+t2+t3)/sc;
writeln(f2,kq:4:1);
close(f1);
close(f2);
end.
Program hotrotinhoc_hoc24;
var d: array[1..35] of real;
i,n: integer;
t,min2,min,bq: real;
begin
write('Nhap so hoc sinh : '); readln(n);
t:=0; min:=32000;
for i:=1 to n
begin
write('d[',i,']='); readln(d[i]);
t:=t+a[i];
if a[i]<min then min:=a[i];
end;
bq:=t/n;
min2:=32000;
for i:=1 to n do
if (a[i]<min2) and (a[i]<bq) then
begin
inc(d);
min2:=a[i];
end;
writeln('Tong ket qua binh quan cua lop la : ',bq:1:1);
writeln('Diem tong ket nho nhat la : ',min:1:1);
writeln('Ti le hoc sinh co diem tong ket be hon diem binh quan la : ',min2:1:1);
readln
end.
uses crt;
var a,b,c,d,tb:real;
begin
clrscr;
write('Nhap diem cua ban:'); readln(a,b,c,d);
tb:=(a+b+c+d)/7;
if tb>=8 then writeln('Gioi');
if (6,5<=tb) and (tb<8) then writeln('Kha');
if (5<=tb) and (tb<6,5) then writeln('Trung Binh');
if tb<5 then writeln('Yeu');
readln;
end.