viết chương trình nhập vào điểm của 3 môn toán văn anh cho mỗi hs trong lớp(lớp có 42 hs).In ra màn hình điểm trung bình cộng của 3 môn đó
viết chương trình nhập điểm 3 môn toán,ngữ văn, tiếng Anh của các bạn trong lớp , sau đó in ra màn hình điểm trung bình của phần toán , văn , tiếng Anh của cả lớp
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.
Viết chương trình nhập vào điểm 2 môn Toán, Văn từ bàn phím. Điểm Anh văn được gán bằng 8.0 điểm. Sau đó tính tổng điểm, điểm trung bình cộng 3 môn học trên và đưa kết quả ra màn hình. (Điểm trung bình cộng lấy 1 số thập phân.) lẹ cho mình nha cảm mưn mn.
câu 1 : hãy viết chương trình cho phép nhập điểm TB 3 môn Toán Văn Anh . Tính Tổng điểm ( TĐ ) và Trung Bình Cộng ( TBC ) 3 môn và đưa kết quả ra màn hình
#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;
}
Viết chương trình nhập vào số hs của lớp và nhập số điểm trung bình cho các hs đó và xuất các điểm vừa nhập ra màn hình
uses crt;
var a:array[1..50]of real;
i,n:integer;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Nhap diem cua ban thu ',i,':'); readln(a[i]);
end;
for i:=1 to n do
writeln('Diem cua ban thu ',i,' la: ',a[i]:4:2);
readln;
end.
Viết chương trình nhập điểm toán, lí, hóa cho các bạn lớp 8a14. Sao đó in ra màn hình điểm trung bình của các bạn trong lớp theo công thức điểm trung bình= ( điểm toán+ điểm lí+ điểm hóa):3 và in ra màn hình kết quả
uses crt;
var a,b,c,tb:array[1..10]of real;
ln,nn:real;
n:integer;
i:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i],b[i],c[i]);
for i:=1 to n do
tb[i]:=(a[i]+b[i]+c[i])/3;
for i:=1 to n do
writeln(tb[i]:4:2);
readln;
end.
Viết chương trình nhập vào điểm các môn toán , tin, anh. Tính và thông báo ra màn hình điểm trung bình 3 môn và dựa vào điểm trung bình hãy xếp loại cho học sinh đó ( Biết rằng học sinh giỏi nếu điểm tất cả các môn đều trên 6,5 và điểm trung bình trên 8, học sinh khá nếu điểm các môn trên 5 và điểm trung bình trên 6,5, còn lại là học sinh trung bình) (C++)
#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.
Viết chương trình sử dụng biến mảng để nhập điểm trung bình môn tin học của các bạn trong lớp em.Thực hiện các yêu cầu sau - in điểm của các banh trong lớp em ra màn hình -tìm bạn có điểm trung bình cao nhất lớp em
uses crt;
var a:array[1..100]of real;
i,n:integer;
ln:real;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do writeln(a[i]);
ln:=a[1];
for i:=1 to n do if ln<a[i] then ln:=a[i];
writeln(ln);
readln;
end.
Viết chương trình nhập trung bình môn Tin học của các bạn học sinh trong lớp. In ra màn hình điểm của các bạn và điểm số lớn nhất (hoặc nhỏ nhất) của lớp.
refer
uses crt;
var i,n:longint;
a:array[1..100] of real;
s1,s,max,min:real;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Diem trung binh mon tin hoc cua ban thu ',i,' la: ');readln(a[i]);
end;
min:=a[1];max:=a[1];
for i:=2 to n do begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i]; end;
for i:=1 to n do
s:=s+a[i];
s1:=s/n;
writeln('So diem cao nhat la: ',max);
writeln('So diem thap nhat la: ',min);
write('Diem TB cua ca lop la: ',s1:0:1);
readln