Nhập vào điểm các môn Toán Văn Anh tính và hiển thị điểm TB ra màn hình
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,b,c,tbc;
int main()
{
cin>>a>>b>>c;
tbc=(a+b+c)/3;
cout<<"Tong la:"<<fixed<<setprecision(2)<<a+b+c<<endl;
cout<<"TBC la:"<<fixed<<setprecision(2)<<tbc;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a,b,c,tb;
int main()
{
cin>>a>>b>>c;
tb=(a+b+c)/3;
cout<<fixed<<setprecision(1)<<tb<<endl;
if (tb>=8) cout<<"Gioi";
else if ((6.5<=tb) and (tb<8)) cout<<"Kha";
else if ((5<=tb) and (tb<=6.5)) cout<<"Trung Binh";
else cout<<"Chua dat";
return 0;
}
var t,dt,a,tb: real;
begin
write('Nhap diem mon Toan: '); readln(t);
write('nhap diem mon Tin: '); readln(dt);
write('Nhap diem mon Anh: '); readln(a);
if (a<=0) or (a>=10) or (t<=0) or (t>=10) or (dt<=0) or (dt>=10) then
repeat
writeln('Khong hop le, nhap lai: ');
write('Nhap diem mon Toan: '); readln(t);
write('nhap diem mon Tin: '); readln(dt);
write('Nhap diem mon Anh: '); readln(a);
until (a>=0) and (a<=10) and (t>=0) and (t<=10) and (dt>=0) and (dt<=10);
tb:=(t+dt+a)/3;
writeln('Diem trung binh: ',tb:2:1);
if (dt>=6.5) and (t>=6.5) and (a>=6.5) and (tb>=8) then writeln('Gioi') else
if (dt>=5) and (t>=5) and (a>=5) and (tb>=6.5) then writeln('Kha') else writeln('Trung binh');
end.
uses crt;
var toan,tin,anh,tb:real;
kt:integer;
begin
clrscr;
repeat
write('Nhap diem Toan:'); readln(toan);
write('Nhap diem Tin:'); readln(tin);
write('Nhap diem Anh:'); readln(anh);
until (0<=toan) and (toan<=10) and (0<=tin) and (tin<=10) and (0<=anh) and (anh<=10);
tb:=(toan+tin+anh)/3;
writeln('Diem trung binh cua 3 mon la: ',tb:4:2);
kt:=0;
if (tb>=8) and (toan>=6.5) and (tin>=6.5) and (anh>=6.5) then kt:=1;
if (6.5<=tb) and (tb<8) and (5<=toan) and (toan<6.5) and (5<=tin) and (tin<6.5) and (5<=anh) and (anh<6.5) then kt:=2;
if kt=0 then writeln('Hoc sinh trung binh');
if kt=1 then writeln('Hoc sinh gioi');
if kt=2 then writeln('Hoc sinh kha');
readln;
end.
Program HOC24;
var i.n: integer;
a: array[1..250] of integer;
begin
for i:=1 to n do
begin
write('Nhap diem toan cua ban thu ',i,': '); readln(a[i]);
end;
for i:=1 to n do write(a[i],' ');
readln
end.
uses crt;
var a,b,c:real;
begin
clrscr;
write('Nhap diem Toan:'); readln(a);
write('Nhap diem Van:'); readln(b);
write('Nhap diem Anh:'); readln(c);
writeln('Diem trung binh la: ',(a+b+c)/3:4:2);
readln;
end.
var i,n,s:integer;
t,v,a,tb:real;
begin
write('Nhap so luong hoc sinh ');readln(n);
for i:=1 to n do
begin
write('Nhap diem toan ');readln(t);
write('Nhap diem van ');readln(v);
write('Nhap diem anh ');readln(a);
s:=t+v+a;
tb:=s/3;
write('DTB cua ban thu ',i,' = ',tb:10:2);
s:=0;
end;
readln
end.
uses crt;
var a,b,c,tb:array[1..10]of real;
ln,nn:real;
i:integer;
begin
clrscr;
for i:=1 to 10 do readln(a[i],b[i],c[i]);
for i:=1 to 10 do
tb[i]:=(a[i]+b[i]+c[i])/3;
ln:=0;
nn:=10;
for i:=1 to 10 do
begin
if ln<tb[i] then ln:=tb[i];
if nn>tb[i] then nn:=tb[i];
end;
writeln(ln:4:2);
writeln(nn:4:2);
for i:=1 to 10 do
begin
if tb[i]>=5 then writeln('Ban thu ',i,' Dat')
else writeln('Ban thu ',i,'Chua dat');
end;
readln;
end.
uses crt;
var a,b,c:integer;
begin
clrscr;
write('Nhap diem Toan:'); readln(a);
write('Nhap diem Van:'); readln(b);
write('Nhap diem Anh:'); readln(c);
writeln((a+b+c)/3:4:2);
readln;
end.