Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
uses crt;
var A:array[1..100] of longint;
i,n,j,tam:longint;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('A[',i,']=');
readln(A[i]);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if A[i]<A[j] then
begin
tam:=A[i];
A[i]:=A[j];
A[j]:=tam;
end;
write('Sap xep theo thu tu giam dan: ');
for i:=1 to n do
write(A[i],',');
readln
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
uses crt;
var i,n,j,tam:integer;
a:array[1..100] of integer;
begin
clrscr;
write('nhap so ptu:');readln(n);
for i:=1 to n do
begin
write('A[',i,']=');
readln(a[i]);
end;
for i:=1 to n do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
write('sap xep theo thu tu giam dan:');
for i:=1 to n do write(a[i],';');
readln;
end.
(mong dc 5*+hay nhất)
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin