B1, Viết chương trình nhập vào điểm trung bình môn Tin học kì I của các bạn lớp em. hãy in ra màn hình điểm trung bình môn Tin lớn nhất của bạn trong lớp
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
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 điểm trung bình môn tin học cuối hk1 của các bạn hc sinh trong lớp em và in ra số điểm cao nhất?
GIÚP EM VỚI Ạ ! MAI EM THI RỒI
Nếu chưa học câu lệnh này thì rep lại cho mình để mình dùng mấy câu lệnh đã học từ b8 trở về trước nhá! Good luck for you :D
uses crt;
var a:array[1..50]of real;
max:real;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('Nhap diem cua ban thu ',i,'='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
0347180518 kb zalo nha
viết chương trình nhập vào điểm trung bình môn tin của các bạn trg lớp sau đó in điểm trung bình cao nhất môn tin [lấy 1 chữ số ở phần thập phân ]
uses crt;
var i,n:byte;Max:real;
a:array[1..50]of real;
begin
clrscr;
write('nhap so hoc sinh cua lop:');readln(n);
for i:=1 to n do
begin
write('nhap diem trung binh mon tin cho hoc sinh thu ',i,':');readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('diem trung binh mon tin cao nhat la: ',Max);
readln;
end.
uses crt;
var i,n:byte;Max:real;
a:array[1..50]of real;
begin
clrscr;
write('nhap so hoc sinh cua lop:');readln(n);
for i:=1 to n do
begin
write('nhap diem trung binh mon tin cho hoc sinh thu ',i,':');readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('diem trung binh mon tin cao nhat la: ',Max:0:1);
readln;
end.
viết chương trình nhập điểm môn tin của các bạn trong lớp mình au đó in ra màn hình sổ bạn số bạn đtaj kết quả học tập loại giỏi khá trung bình và yếu ( theo điều kiện>= 8 điểm giỏi từ 6,5 điểm đến 7,9 điểm khá từ 5 điểm đến 6,4 điểm trung bình dưới 5 điểm yếu)
viết chương trình nhập điểm kiểm tra học kì I môn tin học cho n học sinh (với n và điểm được nhập từ bàn phím ) và in ra các kết quả sau: A: tổng điểm của lớp B:Điểm trung bình của lớp C:điểm cao nhất D:số học sinh đạt trung bình trở lên Lưu ý: Sử dụng biến đếm : For := to đó; Sử dụng biến mảng: var :array[..] of integer;
Viết chương trình nhập vào điểm học kì môn Tin học sau đó tính điểm trung bình của cả lớp, thông báo điểm của học sinh cả lớp và điểm trung bình của lớp?
#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;
}
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 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.