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.
program max_min;
uses crt;
var i,n:integer;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n:');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
writeln('day vua nhap la:');
for i:=1 to n do
write(a[i]:3);
readln;
end.
Program HOC24;
var i,n: integer;
a: array[1..32000] of integer;
begin
write('Nhap N:' ); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap vua nhap la: ');
for i:=1 to n do write(a[i],' ');
readln
end.
uses crt;
var a:array[1..1000000] of longint;
n,i:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Day so vua nhap: ');
for i:=1 to n do write(a[i],' ');
readln;
end.
Var a:array:[1..1000] of integer;
i,n,max,t,d:integer;
s:longint;
tb:real;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap diem thu ',i,' = ');readln(a[i]);
s:=s+a[i];
End;
tb:=s/n;
Write('Cac so vua nhap la: ');
For i:=1 to n do
Write(a[i]:8);
writeln;
writeln('Trung binh cong cua day la ',tb:10:2);
Write('Cac so la boi cua 3 la ');
For i:=1 to n do
if a[i] mod 3 = 0 then write(a[i]:8);
writeln;
write('Cac so le la boi cua 5 la ');
for i:=1 to n do
if (a[i] mod 2 <> 0) and (a[i] mod 5 = 0) then
write(a[i]:8);
Writeln;
max:=a[1];
for i:=1 to n do
if a[i] > max then
begin
max:=a[i];
d:=i;
End;
Writeln('So lon nhat la ',max);
t:=a[1];
a[1]:=max;
a[d]:=t;
Write('Day sau khi dem so lon nhat ra truoc ');
For i:=1 to n do
write(a[i]:8)
writeln;
tb:=(a[8] + a[10])/2);
Write(Trung binh cong cua so thu 8 va thu 10 la ',tb:10:2);
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.
Uses crt;
var max,min,n,i,m,n: longint;
a: array[1..100] of longint
begin clrscr;
for i:=1 to n do begin
if(a[i] mod 2=0) then m:=m+a[i];
if(a[i] mod 2<>0) then n:=n+a[i];
end;
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('Tong cac phan tu chan: ',m);
Writeln('Tong cac phan tu le: ',n);
Writeln('Phan tu co gia tri lon nhat: ',max);
Writeln('Phan tu co gia tri nho nhat: ',min);
readln;
end.
program max_min;
uses crt;
var i,n,max,min:integer;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n:');readln(n);
for i:=1 to n do
begin
write('a[',i,']=');readln(a[i]);
end;
writeln('day vua nhap la:');
for i:=1 to n do
write(a[i]:3);
writeln;
max:=a[1];min:=a[1];
for i:=1 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
writeln('gia tri lon nhat: ',max,' gia tri nho nhat: ',min);
readln;
end.
uses crt;
var a:array[1..1000000] of longint;
n,i,max,min:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Day so vua nhap: ');
for i:=1 to n do write(a[i],' '); writeln;
max:=a[1];min:=a[1];
for i:=2 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
end;
writeln('GTLN: ',max);
writeln('GTNN: ',min);
readln;
end.