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.
#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;
}
uses crt;
var a:array[1..60[of real;
i,n:integer;
begin
clrscr;
write('Nhap so ban:'); readln(n);
for i:=1 to n do
begin
write('Chieu cao cua ban thu ',i,' la: '); readln(a[i]);
end;
for i:=1 to n do
writeln('Ban thu ',i,' cao ',a[i],'m');
readln;
end.
Câu 1:
#include <bits/stdc++.h>
using namespace std;
double a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<fixed<<setprecision(2)<<(a+b+c)/3;
return 0;
}
uses crt;
var cao:array[1..60]of real;
i,n:integer;
max,min:real;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Chieu cao cua ban thu ',i,'='); readln(cao[i]);
end;
max:=cao[1];
min:=cao[1];
for i:=1 to n do
begin
if max<cao[i] then max:=cao[i];
if min>cao[i] then min:=cao[i];
end;
writeln('Chieu cao thap nhat la: ',min:4:2);
writeln('Chieu cao cao nhat la: ',max:4:2);
readln;
end.
#include<iostream>
using namespace std;
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
int g = a + b + c + d + e;
cout << g / 5;
return 0;
}
tham khảo
uses crt;
var cao:array[1..60]of real;
i,n:integer;
max,min:real;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Chieu cao cua ban thu ',i,'='); readln(cao[i]);
end;
max:=cao[1];
min:=cao[1];
for i:=1 to n do
begin
if max<cao[i] then max:=cao[i];
if min>cao[i] then min:=cao[i];
end;
writeln('Chieu cao thap nhat la: ',min:4:2);
writeln('Chieu cao cao nhat la: ',max:4:2);
readln;
end.
Tham khảo
uses crt;
var cao:array[1..60]of real;
i,n:integer;
max,min:real;
begin
clrscr;
write('Nhap so hoc sinh:'); readln(n);
for i:=1 to n do
begin
write('Chieu cao cua ban thu ',i,'='); readln(cao[i]);
end;
max:=cao[1];
min:=cao[1];
for i:=1 to n do
begin
if max<cao[i] then max:=cao[i];
if min>cao[i] then min:=cao[i];
end;
writeln('Chieu cao thap nhat la: ',min:4:2);
writeln('Chieu cao cao nhat la: ',max:4:2);
readln;
end.
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.
Giúp em với ạ