Những câu hỏi liên quan
32.Đinh Văn Thoại 8/4
Xem chi tiết
Kiều Vũ Linh
21 tháng 4 2022 lúc 13:14

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

i,n,min:integer;

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]);

min:=a[1];

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

end;

write('So nho nhat la ',min);

readln;

end.

Bình luận (0)
Kiều Vũ Linh
21 tháng 4 2022 lúc 13:15

Bài này mới đúng nhé!

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

i,n,min:integer;

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;

min:=a[1];

for i:=2 to n do

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

write('So nho nhat la ',min);

readln;

end.

Bình luận (0)
ONLINE SWORD ART
21 tháng 4 2022 lúc 15:18

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

i,n,min:integer;

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;

min:=a[1];

for i:=2 to n do

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

write('So nho nhat la ',min);

readln;

end.

Bình luận (0)
32.Đinh Văn Thoại 8/4
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 4 2022 lúc 16:34

#include <bits/stdc++.h>

using namespace std;

long long a[1000],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]);

cout<<ln;

return 0;

}

Bình luận (0)
Bảo Lê Nguyễn Vũ
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 1 2022 lúc 22:10

#include <bits/stdc++.h>

using namespace std;

long long a[100],n,i,ln,nn,vt1,vt2;

int main()

{

cin>>n;

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

ln=a[1];

nn=a[1];

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

{

ln=max(ln,a[i]);

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

}

cout<<ln<<" "<<nn;

return 0;

}

Bình luận (0)
Kiều Vũ Linh
19 tháng 1 2022 lúc 8:08

Var n,i,vtl,vtn,so max,min:integer;

Begin

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

vtl:=0;

vtn:=0;

max:=-32768;

min:=32767;

For i:=1 to n do

Begin

Write('Nhap vao so thu ',i);readln(so);

If so > max then

Begin

Max:=so;

vtl:=i;

End;

If so < min then

Begin

Min:=so;

vtn:=i;

End;

Writeln('So lon nhat la ',max,' tai vi tri thu ',i);

Write('So nho nhat la ',min,' tai vi tri thu ',i);

Readln;

End.

Bình luận (0)
Mẫn Kim Anh
Xem chi tiết
Kiều Vũ Linh
28 tháng 4 2023 lúc 9:31

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

i,n,min:integer;

s:longint;

begin

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

for i:=1 to n do

begin

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

s:=s+a[i];

end;

writeln('Tong la ',s);

min:=a[1];

for i:=2 to n do

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

write('Cac so chan la ');

for i:=1 to n do

if a[i] mod 2 = 0 then write(a[i]:8);

writeln;

write('so nho nhat la ',min);

readln

end.

Bình luận (0)
nguyễn thị như ý
Xem chi tiết
nguyễn an phát
17 tháng 4 2021 lúc 20:09

program in_mang;

uses crt;

var i,n,max:longint;

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

begin

clrscr;

write('nhap so n:');readln(n);

for i:=1 to n do

begin

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

end;

writeln('cac phan tu chan:');

for i:=1 to n do

if a[i] mod 2=0 then write(a[i]:3);

writeln;

max:=a[1];

for i:=1 to n do

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

writeln('max cua day la:',max);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
19 tháng 4 2021 lúc 19:39

uses crt;

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

i,n,max:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

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

end;

for i:=1 to n do 

  if a[i] mod 2=0 then write(a[i]:4);

writeln;

max:=a[1];

for i:=1 to n do

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

writeln(max);

readln;

end.

 

Bình luận (0)
Hắc Lang
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 21:51

uses crt;

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

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

t:=0;

for i:=1 to n do 

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

writeln(t);

readln;

end.

Bình luận (0)
Huy Phạm
Xem chi tiết
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:12

1)

Var array:[1..1000] of integer;

i,n,t:integer;

Begin

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

For i:=1 to n do

Begin

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

End;

For i:=1 to n do

If a[i] > a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep tang dan ');

For i:=1 to n do write(a[i]:8);

Readln

End.

Bình luận (0)
Kiều Vũ Linh
3 tháng 5 2023 lúc 6:13

2)

Var array:[1..1000] of integer;

i,n,t:integer;

Begin

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

For i:=1 to n do

Begin

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

End;

For i:=1 to n do

If a[i] < a[i+1] then

Begin

t:=a[i];

a[i]:=a[i+1];

a[i+1]:=t;

End;

Write('Sap xep giam dan ');

For i:=1 to n do write(a[i]:8);

Readln

End.

Bình luận (0)
erddedfrferf ffvf fd
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 2 2022 lúc 16:53

#include <bits/stdc++.h>

using namespace std;

long long a[1000],i,n,nn;

int main()

{

cin>>n;

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

for (i=1; i<=n; i++) if (a[i]%2!=0) cout<<i<<" ";

cout<<endl;

nn=a[1];

for (i=1; i<=n; i++) nn=min(nn,a[i]);

cout<<nn<<endl;

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

return 0;

}

Bình luận (2)
Jeri James
Xem chi tiết
Minh Lệ
6 tháng 4 2023 lúc 22:43

Program HOC24;

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

i,k,min: integer;

begin

write('Nhap K: '); readln(k);

for i:=1 to k do 

begin

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

end;

min:=a[1];

for i:=2 to k do if a[i]<min then min:=a[i];

write('Phan tu nho nhat trong day so la: ',min);

readln

end.

Bình luận (0)
HT.Phong (9A5)
6 tháng 4 2023 lúc 6:20

Uses crt;

var i,k,min: longint;

h: array[1..100] of longint;

begin clrscr;

readln(k);

for i:=1 to k do begin

readln(h[i]);

end;

min:=h[1];

for i:=1 to n do begin

if(min>h[i]) then min:=h[i];

end;

writeln(min);

readln;

end.

Bình luận (0)