Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
hoho209
Xem chi tiết
Kiều Vũ Linh
6 tháng 5 2021 lúc 9:16

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

tb:real;

i,n:integer;

s:longint;

begin

     write('Nhap vao so luong so nguyen '); readln(n);

     s:=0;

     for i:=1 to n do

     begin

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

          s:=s+a[i];

     end;

     tb:=s/n;

     writeln('Gia tri trung binh cua mang do la ',tb:10:2);

     writeln('Cac phan tu lon hon gia tri trung binh la');

     for i:=1 to n do

     begin

          if a[i] > tb then write(a[i]:10);

     end;

readln;

end.

Khue Nguyen
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 5 2022 lúc 19:38

uses crt;

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

i,n,t:integer;

tb:real;

begin

clrscr;

readln(n);

for i:=1 to n do readln(a[i]);

t:=0;

for i:=1 to n do t:=t+a[i];

writeln(t/n:4:2);

tb:=t/n;

for i:=1 to n do 

  if a[i]<tb then write(a[i]:4);

readln;

end.

ahihi bảo
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 4 2021 lúc 22:11

uses crt;

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

i,n,tb:integer;

begin

clrscr;

write('n='); readln(n);

for i:=1 to n do 

 begin

write('A[',i,']='); readln(a[i]);

end;

tb:=0;

for i:=1 to n do 

  tb:=tb+a[i];

writeln('Trung binh cua day so la: ',tb:4:2);

writeln('Cac so lon hon gia tri trung binh la: ');

for i:=1 to n do 

  if a[i]>tb then write(a[i]:4);

readln;

end.

Ánh sao
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 4 2021 lúc 20:15

Câu 1: 

uses crt;

var a:array[1..5]of integer;

max,i:integer;

begin

clrscr;

for i:=1 to 5 do 

  begin

write('A[',i,']='); readln(a[i]);

end;

max:=a[1];

for i:=1 to 5 do 

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

writeln(max);

readln;

end.

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

Câu 2: 

uses crt;

var a:array[1..6]of integer;

min,i:integer;

begin

clrscr;

for i:=1 to 6 do 

  begin

write('A[',i,']='); readln(a[i]);

end;

min:=a[1];

for i:=1 to 6 do 

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

writeln(min);

readln;

end.

huy123
Xem chi tiết
bảo nhi
Xem chi tiết
Kiều Vũ Linh
29 tháng 4 2023 lúc 11:12

Var a:array[1..100] of integer;

i,n:integer;

s:longint;

tbc:real;

Begin

Repeat

Write('n = ');readln(n);

Until (n>0) and (n<=100);

For i:=1 to n do

Begin

Write('Nhap phan tu thu ',i);readln(a[i]);

s:=s+a[i];

End;

tbc:=s/n;

Write('Trung binh cong la ',tbc:10:2);

Readln

End.

Yuki
Xem chi tiết
Vũ Quang Huy
11 tháng 5 2022 lúc 0:35

tham khảo'

 

uses crt;

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

i,n,t,dem:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

t:=0;

dem:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then

begin

t:=t+a[i];

inc(dem);

end;

writeln('Tong cac so chan la: ',t);

writeln('So luong so chan la: ',dem);

readln;

end.

Kiều Vũ Linh
11 tháng 5 2022 lúc 7:49

Var a:array[1..100] of integer;

i,n,dem,vt,s sc,sl,min:integer;

tbc:real;

Begin

Write('Nhap so luong phan tu n = ');readln(n);

For i:=1 to n do

Begin

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

End;

For i:=1 to n do s:=s+a[i];

tbc:=s/n;

Writeln('Gia tri trung binh cua mang la ',tbc:10:2);

Write('Cac phan tu lon hon gia tri trung binh la ');

For i:=1 to n do

If a[i]>tbc then write(a[i],'   ');

For i:=1 to n do

Begin

If a[i] mod 2 = 0 then sc:=sc+a[i]

Else sl:=sl+a[i];

End;

Writeln('Tong cac phan tu chan la ',sc);

Writeln('Tong cac phan tu le la ',sl);

min:=a[1];

For i:=2 to n do

Begin

If a[i] < min then min:=a[i];

vt:=i;

End;

Writeln('Phan tu nho nhat la ',min,' tai vi tri ',vt);

For i:=1 to n do

If a[i] mod 5 = 0 then dem:=dem+1;

Write('So cac phan tu chia het cho 5 la ',dem);

Readln;

End.

ngu ngốc
Xem chi tiết
Nguyễn Lê Phước Thịnh
6 tháng 4 2022 lúc 23:05

#include <bits/stdc++.h>

using namespace std;

long long a[1000],n,i,s,t;

int main()

{

cin>>n;

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

s=1;

for (i=1; i<=n; i++) s*=a[i];

cout<<s<<endl;

t=0;

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

t+=a[i];

cout<<fixed<<setprecision(2)<<(t*1.0)/(n*1.0);

return 0;

}

Lê Thị Hồng anh
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 2 2022 lúc 21:29

#include <bits/stdc++.h>

using namespace std;

long long a[40],i,n,ln;

int main()

{

cin>>n;

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

{

cin>>a[i];

}

ln=a[1];

for (i=1; i<=n; i++) ln=max(ln,a[i]);

for (i=n; i>=1; i--)

if (ln==a[i]) 

{

cout<<i;

break;

}

return 0;

}