eoiqd123
Xem chi tiết
eoiqd123
Xem chi tiết
Võ Thị Thanh Trúc
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 3 2021 lúc 13:30

uses crt;

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

n,i,t,max,min: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] mod 3=0 then t:=t+a[i];

writeln('Tong cac so la boi cua 3 la: ',t);

max:=a[1];

min:=a[1];

for i:=1 to n do 

begin

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

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

end;

writeln('Gia tri lon nhat la: ',max);

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

readln;

end.

Bình luận (0)
Quang Trần Đăng
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 10 2021 lúc 23:24

#include <bits/stdc++.h>

using namespace std;

long long n,x,ln,i;

int main()

{

cin>>n;

cin>>x;

ln=x;

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

{

cin>>x;

if (ln<=x) ln=x;

}

cout<<ln;

return 0;

}

 

Bình luận (0)
NGUYỄN HOÀNG DŨNG
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 10 2021 lúc 0:47

a:

#include <bits/stdc++.h>

using namespace std;

long long n,x,i,ln;

int main()

{

cin>>n>>x;

ln=x;

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

{

cin>>x;

ln=max(ln,x);

}

cout<<ln;

return 0;

}

Bình luận (0)
vũ minh hiếu
Xem chi tiết
thu Phạm
28 tháng 4 2015 lúc 13:46

vĩ nguyen duong nen bang 1

 

 

Bình luận (0)
Leoumax
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 2 2023 lúc 20:54

Bai 2:

uses crt;

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

i,n,t,nn:integer;

begin

clrscr;

readln(n);

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

nn:=a[1];

for i:=1 to n do

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

write(nn);

readln;

end.

Bình luận (0)
anh vương
Xem chi tiết
Nguyễn Lê Phước Thịnh
27 tháng 5 2022 lúc 21:58

uses crt;

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

i,n,t,ln,nn:integer;

begin

clrscr;

readln(n);

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

t:=0;

for i:=1 to n do

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

ln:=a[1];

nn:=a[1];

for i:=1 to n do 

begin

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

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

end;

writeln(t);

writeln(ln);

writeln(nn);

readln;

end.

Bình luận (1)
Hoàng Văn Xanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 4 2021 lúc 13:32

uses crt;

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

i,n,min:integer;

begin

clrscr;

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

for i:=1 to n do 

 begin

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

end;

min:=a[1];

for i:=1 to n do 

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

writeln(min);

readln;

end.

Bình luận (0)