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.
Var a:array:[1..1000] of real;
i,n:integer;
max,min,s,tb:real;
Begin
Write('Nhap so luong hoc sinh: ');readln(n);
For i:=1 to n do
Begin
Write('Nhap chieu cao hs thu ',i,' = ');readln(a[i]);
s:=s+a[i];
End;
tb:=s/n;
max:=a[1];min:=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;
writeln('Chieu cao lon nhat la ',max:10:1);
Writeln('Chieu cao nho nhat la ',min:10:1);
Write('Chieu cao trung binh la ',tb:10:1);
Readln
End.
uses crt;
var st:array[1..10]of string;
a:array[1..10]of integer;
i,n:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(st[i],a[i]);
for i:=1 to n do
writeln(st[i],' ',a[i]);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a[1000],t;
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<fixed<<setprecision(2)<<t/(n*1.0);
return 0;
}
Program HOC24;
var Toan,Ly,Tin,TBMToan,TBMLy,TBMTin: real;
i,n: byte;
begin
write('Nhap so ban hoc sinh trong lop: '); readln(n);
for i:=1 to n do
begin
write('Nhap diem Toan; Ly; Tin cua ban thu ',i,': ');
readln(Toan[i],Ly[i],Tin[i]);
end;
TBMToan:=0; TBMLy:=0; TBMTin:=0;
For i:=1 to n do
begin
TBMToan:=TBMToan+Toan[i];
TBMLy:=TBMLy+Ly[i];
TBMTin:=TBMTin+Tin[i];
end;
writeln('Diem trung binh mon Toan la: ',TBMToan:5:1);
writeln('Diem trung binh mon Ly la: ',TBMLy:5:1);
writeln('Diem trung binh mon Tin la: ',TBMTin:5:1);
For i:=1 to n do
writeln('Diem trung binh 3 mon cua ban thu ',i,' la: ',TBMToan+TBMLy+TBMTin:5:1);
Readln
end.
uses crt;
var a,b,c:real;
begin
clrscr;
readln(a,b,c);
writeln((a+b+c)/3:4:2);
readln;
end.
Program nữa ạ