Những câu hỏi liên quan
ẩn danh
Xem chi tiết
Như Huỳnh
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 5 2022 lúc 10:52

uses crt;

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

i,n,dem:integer;

begin

clrscr;

readln(n);

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

dem:=0;

for i:=1 to n do if a[i] mod 2=0 then inc(dem);

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

writeln('so so le la: ',n-dem);

readln;

end.

Bình luận (0)
Thiên Kim
Xem chi tiết
ngô bá hiếu
Xem chi tiết
Kiều Vũ Linh
1 tháng 5 2023 lúc 18:38

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

s:longint;

i,n:integer;

Begin

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

For i:=1 to n do

Begin

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

If a[i] > 0 then s:=s+a[i];

End;

Write('Tong la ',s);

Readln

End.

Bình luận (0)
Nguyễn Ngọc Thiện Nhân
1 tháng 5 2023 lúc 10:16

Bình luận (3)
Phạm Công Ngọc Quốc
Xem chi tiết
Phạm Công Ngọc Quốc
26 tháng 4 2022 lúc 21:23

giúp mik với mai thi mik thi rồi🙏🙏

 

Bình luận (0)
Thế Thôi
26 tháng 4 2022 lúc 22:48

program b1;
uses crt;
var i: integer; a:array[1..100] of integer; s:longint;
begin
clrscr;
for i:=1 to 10 do
begin
write('a[',i,']='); readln(a[i]);
end;
writeln('cac phan tu chan la:');
s:=0;
for i:=1 to 10 do if a[i] mod 2=0 then writeln(a[i],' ');
write('Tong cac phan tu le la:');
for i:=1 to 10 do if a[i] mod 2<>0 then s:=s+a[i]; write(s);
readln;
end.

Tham khảo!

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)
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)
Huyền Trần
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 5 2021 lúc 20:30

uses crt;

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

i,n,h:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

h:=0;

for i:=1 to n do 

  if a[i] mod 2=0 then h:=h-a[i];

writeln(h);

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)