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],b[100],c[100],tb[100];
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i]>>b[i]>>c[i];
for (i=1; i<=n; i++)
tb[i]=(a[i]+b[i]+c[i])/3;
for (i=1; i<=n; i++)
cout<<"Diem cua ban thu "<<i<<" la: "<<fixed<<setprecision(2)<<tb[i]<<endl;
return 0;
}
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.
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.
Tham khảo
Var a,b:array[1..100] of integer;
c: array[1..100] of real;
i,n:integer;
Begin
write('Nhap so hoc sinh: ');readln(n);
writeln('Nhap diem Toan');
for i:=1 to n do begin write(i,'. ');readln(a[i]);end;
writeln('Nhap diem Van');
for i:=1 to n do begin write(i,'. ');readln(b[i]);end;
for i:=1 to n do c[i]:=(a[i]+b[i])/2;
writeln('Diem trung binh');
for i:=1 to n do writeln(i,'. ',c[i]);
readln
uses crt;
var NS:array[1..100] of integer; Dtoan,Dvan,Dtb:array[1..100] of real;
hoten:array[1..100] of string; i:byte;
begin
clrscr;
for i:=1 to 45 do
begin
write('Nhap ten cua hoc sinh thu',i,':'); readln(hoten[i]);
write('Nhap ngay sinh:'); readln(NS[i]);
write('Nhap diem toan:'); readln(Dtoan[i]);
write ('Nhap diem van:'); readln(Dvan[i]);
Dtb[i]:=(Dtoan[i]+Dvan[i])/2;
end;
writeln('Diem trung binh cua cac ban trong lop la:');
for i:=1 to 45 do
writeln(hoten[i],':',Dtb[i]:1:2);
readln;
end.
Tham khảo thui!
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.
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
program TimDiemCaoNhat;
var
diem: array[1..30] of integer;
i, diemCaoNhat, soThuTu: integer;
begin
for i := 1 to 30 do
begin
write('Nhap diem cua ban thu ', i, ': ');
readln(diem[i]);
end;
diemCaoNhat := diem[1];
soThuTu := 1;
for i := 2 to 30 do
begin
if diem[i] > diemCaoNhat then
begin
diemCaoNhat := diem[i];
soThuTu := i;
end;
end;
writeln('Diem cao nhat la: ', diemCaoNhat);
writeln('Ban thu ', soThuTu, ' dat diem cao nhat.');
readln;
end.
Program HOC24;
Var a,b: array[1..32000] of real;
i,n: integer;
max,d1,d: real;
begin
write('Nhap so hoc sinh : '); readln(n);
for i:=1 to n do
begin
write('Nhap diem toan ban thu ',i,' : '); readln(a[i]);
write('Nhap diem van ban thu ',i,' : '); readln(b[i]);
end;
max:=0;
for i:=1 to n do
begin
d:=a[i]+b[i];
d1:=d/2;
if d1>max then max:=d1;
end;
write('Diem trung binh cao nhat la : ',max);
readln
end.