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 v,r:text;
n,i,d,tam,j:integer;
a:array[1..100] of integer;
begin
assign(v,'Nhap.inp');
reset(v);
readln(v,n);
for i:=1 to n do readln(v,a[i]);
assign(r,'Xuat.out');
rewrite(r);
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;
i:=1;
while a[i]=a[i+1] do
begin
d:=d+1;
i:=i+1;
end;
if d<>n-1 then write(r,a[i+1]) else write(r,'khong tim thay');
close(r);
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
uses crt;
var n,i,j,tg: integer;
a: array[1..10] of integer;
fi,fo: text;
begin
assign(fi,'Nhap.txt'); reset(fi);
assign(fo,'Xuat.txt'); rewrite(fo);
readln(fi,n);
for i:=1 to n do read(fi,a[i]);
for i:=1 to n do for j:=i+1 to n do if a[i]>a[j] then begin
tg:=a[i];
a[i]:=a[j];
a[j]:=tg;
end;
for i:=n downto 1 do if a[i]<>a[i-1] then begin
write(fo,a[i-1]);
break;
end;
close(fi);
close(fo);
end.
Hãy giúp mọi người biết câu trả lời này thế nào?
ko đang hỏi :V
ko
in ra 5
âu kê
mà code sai rồi :))
chạy nó sai :< (copy phần sắp xếp)
à hông đúng :V
đã update code
Bảng tin