viet chuong trinh nhap vao diem thuong xuyen ,giua ki, cuoi ki, tinh diem diem trung binh mon hoc (tbm) va xep loai hoc luc mon do ,biet rang : thuong xuyen (he so 1),giua ky (he so 2),cuoi ky (he so 3)
TBM>=8: xep loai gioi
6.5=
viet chuong trinh nhap vao diem thuong xuyen ,giua ki, cuoi ki, tinh diem diem trung binh mon hoc (tbm) va xep loai hoc luc mon do ,biet rang : thuong xuyen (he so 1),giua ky (he so 2),cuoi ky (he so 3)
TBM>=8: xep loai gioi
6.5=
đây bạn
program ctpt;
uses crt;
var A: array[1..500] of real;
i, n: integer;
tb, t, g, c, S: real;
begin
clrscr;
write(‘Nhap diem thi giua ki: ‘); readln(g);
write(‘Nhap diem thi cuoi ki: ‘); readln(c);
write(‘Ban co may cot diem thuong xuyen?: ‘); readln(n);
write(‘Nhap diem thuong xuyen cua ban: ‘);
S:=0;
for i:=1 to n do
begin
readln(A[i]);
S:=S+A[i];
end;
write(‘Tong diem thuong xuyen cua ban: ‘, S);
tb:=(S*1+g*2+c*3)/(n+5);
if (tb>10) or (tb<0) then write(‘Nhap diem sai’) esle
begin
write(‘Diem trung binh mon cua ban la: ‘, tb:4:1);
if tb>=8 then write(‘Gioi’) else
if (tb>=6.5) and (tb<8) then write(‘Kha’) else
if (tb>=5) and (tb<6.5) then write(‘TB’) else
write(‘Yeu’);
end;
readln
end.