Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do write(a[i]:4);
readln;
end.
Program HOC24;
var min,j,i,n,tg: integer;
t: longint;
a: array[1..1000] of integer;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
t:=0;
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' ') else t:=t+a[i];
writeln; writeln('Tong cac so le la: ',t);
min:=a[1];
for i:=2 to n do if a[i]<min then min:=a[i];
writeln('So nhat nhat la: ',min);
for i:=1 to n do
for j:=i to n do
if a[i]>a[j] then
begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=1 to n do write(a[i],' ');
readln
end.
Uses crt;
var i,n,min,k,e,j: longint
a: array[1..100] of longint;
begin clrscr;
readln(n);
for i:=1 to n do read(n); readln;
for i:=1 to n do if(a[i] mod 2=0) then write(a[i],' ');
for i:=1 to n do if(a[i] mod 2<>0) then k:=k+a[i];
min:=a[i];
for i:=1 to n do if(min>a[i]) then min:=a[i];
writeln(min);
for i:=1 to n-1 do
for j:=i+1 to n do if a[j] <=a[i] then
begin e:= a[i];
a[i]:=a[j];
a[j]:=e; end;
for i:=1 to n do write(a[i],';');
readln;
end.
Program HOC24;
var d,i,n: integer;
t: real;
begin
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
d:=0; t:=0;
for i:=1 to n do
if a[i] mod 2=0 then
begin
d:=d+1;
t:=t+a[i];
end;
t:=t/d;
writeln('Co ',d,' so chan trong mang');
writeln('Trung binh cong cac phan tu chan la: ',t:2:5);
write('Cac phan tu trong day theo chieu doc: ');
for i:=1 to n do writeln(a[i]);
readln
end.
Var a:array[1..100] of integer;
i,n:integer;
s:longint;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap phan tu thu ',i,' = ');readln(a[i]);
s:=s+a[i];
End;
Write('Cac phan tu vua nhap la ');
For i:=1 to n do
Write(a[i]:8);
Writeln;
Write('Tong cua chung la ',s);
Readln
End.