Những câu hỏi liên quan
Nguyen Tan Dat
Xem chi tiết
Kiều Vũ Linh
19 tháng 5 2023 lúc 7:45

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.

Trần My
Xem chi tiết
Nguyễn Liên
18 tháng 4 2021 lúc 10:22

a)

var a:array[1..100] of longint;

      n,i,max,d:longint;

begin

read(n);

for i:=1 to n do

write('nhap chieu cao, don vi cm');read(a[i]);

b) max:=a[1];

for i:=2 to n do

if a[i]>max then max:=a[i];

writeln('ban cao nhat cao',max);

c) for i:=1 to n do

if a[i]>160 then d:=d+1;

write('so ban cao hon 160 cm la: ',d);

end.

 

Nguyễn Lê Phước Thịnh
19 tháng 4 2021 lúc 19:34

uses crt;

var a:array[1..50]of real;

max:real;

i,n,dem:integer;

begin

clrscr;

write('Nhap so hoc sinh:'); readln(n);

for i:=1 to n do 

  begin

write('Nhap chieu cao 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('Chieu cao lon nhat la: ',max);

dem:=0;

for i:=1 to n do 

  if a[i]>1.6 then inc(dem);

writeln('So hoc sinh cao hon 1,6m la: ',dem);

readln;

end.

Anh Nguyễn
Xem chi tiết
Nguyễn Minh Trường
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:33

#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;

}

Tuấn Trần thị
Xem chi tiết
Kiều Vũ Linh
10 tháng 5 2023 lúc 17:41

Var a:array:[1..50] of real;

i,max:integer;

Begin

For i:=1 to 50 do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

Write('Cac diem vua nhap la: ');

For i:=1 to 50 do 

Write(a[i]:10:2);

Writeln;

max:=a[1];

For i:=2 to 50 do

if a[i]>max then max:=a[i];

Write('Diem trung binh lon nhat la ',max:10:2);

Readln

End.

Kiều Vũ Linh
10 tháng 5 2023 lúc 17:44

Var a:array:[1..50] of real;

i:integer;

max:real;

Begin

For i:=1 to 50 do

Begin

Write('Nhap diem thu ',i,' = ');readln(a[i]);

End;

Write('Cac diem vua nhap la: ');

For i:=1 to 50 do 

Write(a[i]:10:2);

writeln;

max:=a[1];

For i:=2 to 50 do

if a[i] > max then max:=a[i];

write('Diem lon nhat la ',max:10:2);

Readln

End.

Hà Nguyễn Thái Bình
Xem chi tiết
Nguyên Đăng
Xem chi tiết
Mối tình chong gai
Xem chi tiết
Đỗ Tuệ Lâm
12 tháng 4 2022 lúc 11:24

tham khảo:

undefined

Nguyễn Lê Phước Thịnh
13 tháng 4 2022 lúc 18:33

#include <bits/stdc++.h>

using namespace std;

double a[100];

int n,i;

int main()

{

cin>>n;

for (i=1; i<=n; i++) cin>>a[i];

for (i=1; i<=n; i++)

if (a[i]>=1.5) cout<<fixed<<setprecision(2)<<a[i]<<" ";

return 0;

}

Bùi Huỳnh Anh Sơn
Xem chi tiết