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 HOC24;
var a: array[1..32000] of integer;
i,max,,n: integer;
begin
write('Nhap so phan tu 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 a[i]<max then max:=a[i];
write('So lon nhat la: ',max);
readln
end.
uses crt;
var a:array[1..1000000] of longint;
n,i,max:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
max:=a[1];
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
if a[i]>max then max:=a[i];
end;
writeln('GTLN: ',max);
readln;
end.
Program HOC24;
var i,n,max: integer;
a: array[1..1000] of integer;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do if a[i]>max then max:=a[i];
write('So lon nhat la: ',max);
readln
end.
Var z:array[1..1000] of longint;
n, i, max:longint;
Begin
Readln(n);
For i:=1 to n do begin writeln('s',i,'=');
Readln(z[i]);
max:= z[1];
End;
uses crt;
var a:array[1..100]of integer;
i,n,max,dem1,dem2: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('So lon nhat la: ',max);
readln;
end.
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]);
t:=0;
for i:=1 to n do
if a[i]>0 then t:=t+a[i];
writeln(t);
readln;
end.
program tinh_trung_binh_cong;
uses crt;
var i,n,max,min:integer
tbc:real;
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;
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;
tbc:=(max+min)/2;
writeln(tbc);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,max,min: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];
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((max+min)/2:4:2);
readln;
end.
program tinh_trung_binh_cong;
uses crt;
var i,n,max,min:integer
tbc:real;
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;
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;
tbc:=(max+min)/2;
writeln(tbc);
readln;
end
uses crt;
var a:array[1..100]of integer;
i,n,max,min: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];
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((max+min)/2:4:2);
readln;
end.
uses crt;
var a:array[1..100] of integer;
i,n,ln:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
readln(a[i]);
ln:=0;
for i:=1 to n do
if trunc(sqrt(A[i]))=sqrt(a[i]) then
begin
write(a[i]:4);
if ln<A[i] then ln:=A[i];
end;
writeln;
writeln('So chinh phuong lon nhat la: ',ln);
readln;
end.
Bài 5:
Var a:array:[1..1000] of integer;
i,n,max:integer;
sc, sl:longint;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');rreadlna[i]);
If a[i] mod 2 = 0 then sc:=sc+b[i];
If a[i] mod 2 <> 0 then sl:=sl+a[i];
End;
max:=a[1];
For i:=2 to n do
If a[i] > max then max:=a[i];
Writeln('Tong cac so chan la ',sc);
Writeln('Tong cac so le la ',sl);
write('So lon nhat la ',max);
Readln
End.
var a:array[1..100]of longint;
n,i,max:longint;
begin
read(n); {nhập số phần tử trong dãy}
for i:=1 to n do read(a[i]); {nhập giá trị các phần tử}
max:=a[1]; {gán max=giá trị của phần tử thứ nhất}
for i:=2 to n do
if a[i]>max then max:=a[i];
write('gia tri lon nhat trong day la: ',max);
end.
Ấn đồng thời alt+f5 để xem kq nhé!!!
Đánh giá zùm nhe :)
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('So lon nhat la: ',max);
readln;
end.