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.
#include <bits/stdc++.h>
using namespace std;
double a[100],t;
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
cout<<"Diem cua ban thu "<<i<<" la: "<<fixed<<setprecision(2)<<a[i]<<endl;
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<"Trung binh cua lop la: "<<fixed<<setprecision(2)<<t/(n*1.0);
return 0;
}
uses crt;
var toan,ly,hoa,van,anh,dtb:real;
begin
clrscr;
write('Nhap diem Toan:'); readln(toan);
write('Nhap diem Ly:'); readln(ly);
write('Nhap diem Hoa:'); readln(hoa);
write('Nhap diem Van:'); readln(van);
write('Nhap diem Anh:'); readln(anh);
dtb:=(toan+ly+hoa+van+anh)/5;
if dtb>=8 then writeln('Gioi');
if (6,5<=dtb) and (dtb<8) then writeln('Kha');
if (5<=dtb) and (dtb<6,5) then writeln('Trung binh');
if dtb<5 then writeln('Yeu');
readln;
end.
uses crt;
var a:array[1..10]of integer;
i,n,tb:integer;
begin
clrscr;
for i:=1 to 10 do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to 10 do
if a[i]>=8 then write(a[i]:4);
tb:=0;
for i:=1 to 10 do
tb:=tb+a[i];
writeln;
writeln('Diem trung binh cua 10 ban la: ',tb:4:2);
readln;
end.
program DiemTB;
var
diemToan, diemVan, diemTB: real;
begin
write('Nhap diem mon Toan: ');
readln(diemToan);
write('Nhap diem mon Van: ');
readln(diemVan);
diemTB := (diemToan + diemVan) / 2;
writeln('Diem trung binh: ', diemTB:0:2);
if diemTB >= 5 then
writeln('Chuc mung! Ban da dau ky thi.')
else
writeln('Rat tiec! Ban da truot ky thi.');
readln;
end.