Những câu hỏi liên quan
Huy Hoàng Phạm
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 12 2021 lúc 8:06

#include <bits/stdc++.h>

using namespace std;

long long n,i,a[10000];

int main()

{

cin>>n;

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

cin>>a[i];

for (i=1; i<=n; i++) cout<<a[i]<<" ";

return 0;

}

Bình luận (0)
hihi
Xem chi tiết
Nguyễn Lê Phước Thịnh
25 tháng 2 2021 lúc 22:05

uses crt;

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

i,n,dem,dem1,dem2,t:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

write('B[',i,']='); readln(b[i]);

end;

dem:=0;

dem1:=0;

for i:=1 to n do 

begin

if b[i]<0 then inc(dem);

if b[i]>0 then inc(dem1);

end;

writeln('So phan tu am la: ',dem);

writeln('So phan tu duong la: ',dem1);

t:=0;

for i:=1 to n do 

 if b[i]<>0 then t:=t+b[i];

writeln('Trung binh cac phan tu khac 0 trong mang la: ',t/(dem+dem1):4:2);

min:=b[1];

for i:=1 to n do

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

dem2:=0;

for i:=1 to n do 

  if min=b[i] then

begin

 inc(dem2);

a[dem2]:=i;

end;

writeln('Gia tri nho nhat la: ',min);

writeln('Chi so la: ');

for i:=1 to dem2 do 

  write(a[i]:4);

readln;

end.

Bình luận (1)
Quân Nguyễn
Xem chi tiết
Nguyễn Lê Phước Thịnh
26 tháng 6 2021 lúc 19:18

uses crt;

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

m,n,t,min,vt:integer;

begin

clrscr;

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

for i:=1 to m do 

  begin

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

end;

for i:=1 to m do 

  write(a[i]:4);

writeln;

t:=0;

for i:=1 to m do 

  t:=t+a[i];

writeln('Tong cac phan tu la: ',t);

min:=a[1];

for i:=1 to n do 

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

vt:=0;

for i:=1 to n do 

 if min=a[i] then inc(vt);

writeln('So nho nhat la: ',min);

writeln('So lan xuat hien la: ',vt);

readln;

end.

Bình luận (0)
Vương Thị Minh Tâm
Xem chi tiết
vũ minh nhật
1 tháng 1 2022 lúc 12:23

a

Bình luận (0)
Nguyễn Lê Phước Thịnh
1 tháng 1 2022 lúc 14:04

#include <bits/stdc++.h>

using namespace std;

long long a[1000],i,n;

int main()

{

cin>>n;

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

for (i=1; i<=n; i++) cout<<a[i]<<" ";

return 0;

}

Bình luận (0)
Diễm Phạm Thị Hồng
Xem chi tiết
Diễm Phạm Thị Hồng
31 tháng 7 2023 lúc 22:25

Mn giúp e vơi e đang cần gấp!!!!!

Bình luận (0)
Khanh Linh
Xem chi tiết
Minh Lệ
18 tháng 2 2021 lúc 19:10

Program HOC24;

var i.n: integer;

a: array[1..250] of integer;

begin

for i:=1 to n do

begin

write('Nhap diem toan cua ban thu ',i,': '); readln(a[i]);

end;

for i:=1 to n do write(a[i],' ');

readln

end.

Bình luận (0)
Buddy
18 tháng 2 2021 lúc 9:35

uses crt;

var i,n:integer;     A: Array[1..50] of integer;begin        clrscr;        readln(n);readln(k);        for i:=1 to n do        begin                write('A[',i,'] = ');                readln(A[i]);        end;        for i:=1 to A[i] do        if (A[i] > k) then write(A[i]);        readlnend.

Bình luận (0)
Nguyễn Lê Phước Thịnh
18 tháng 2 2021 lúc 20:51

uses crt;

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

i,n:integer;

begin

clrscr;

repeat

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

until (0<n) and (n<=50);

for i:=1 to n do 

  begin

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

end;

for i:=1 to n do

  writeln(a[i]:4:2);

readln;

end.

Bình luận (0)
Benny
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 3 2023 lúc 14:55

6:

#include <bits/stdc++.h>

using namespace std;

int main()

{

int n,A[100],i,dem=0;

cin>>n;

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

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

if (A[i]%2!=0) dem++;

cout<<dem;

return 0;

}

5:

#include <bits/stdc++.h>

using namespace std;

int main()

{

long long n,nn=1e6,A[1000];

cin>>n;

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

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

nn=min(nn,A[i]);

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

if (nn==A[i]) cout<<i<<" ";

return 0;

}

Bình luận (0)
An Phạm
Xem chi tiết
Kiều Vũ Linh
28 tháng 4 2023 lúc 16:06

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

i,n,d,max:integer;

begin

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

for i:=1 to n do

begin

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

if a[i] mod 2 <> 0 then d:=d+1;

end;

max:=a[1];

for i:=2 to n do

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

writeln('Co ',d,' so le');

write('So lon nhat la ',max);

readln

end.

Bình luận (0)
Tuyên Dương
Xem chi tiết