Những câu hỏi liên quan
Uchiha Obito
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 5 2021 lúc 19:59

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)
Hắc Lang
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 5 2021 lúc 22:02

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;

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 (1)
Thwn Dayy
Xem chi tiết
Kiều Vũ Linh
5 tháng 5 2023 lúc 9:27

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

i,n,min:integer;

begin

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

for i:=1 to n do

begin

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

end;

min:=a[1];

for i:=2 to n do

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

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

readln

end.

Bình luận (2)
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)
Uchiha Obito
Xem chi tiết
Nguyễn Lê Phước Thịnh
9 tháng 5 2021 lúc 20:37

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;

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)
Thư ĐT
Xem chi tiết
Bảo Trâm
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 4 2021 lúc 12:51

uses crt;

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

i,n,s:integer;

begin

clrscr;

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

for i:=1 to n do

begin

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

end;

s:=1;

for i:=1 to n do 

  s:=s*a[i];

writeln(s);

readln;

end.

Bình luận (0)
Bé Kunz
Xem chi tiết
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:24

Bài 1: 

uses crt;

var a:array[1..200]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] mod 5=0 then t:=t+a[i];

writeln('Tong cac so chia het cho 5 la: ',t);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
21 tháng 3 2021 lúc 22:25

Bài 2: 

uses crt;

var st:string;

d,i:integer;

begin

clrscr;

write('Nhap xau:'); readln(st);

d:=length(st);

for i:=1 to d do 

  if st[i]=#32 then delete(st,i,1);

writeln(st);

readln;

end.

Bình luận (0)
scar titan
28 tháng 7 2021 lúc 10:11

python có ko bạn

 

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)