题意
找出最大的数和它的序号
分析
先长度排序,长度相同,就字符串排序
var
n,i,j:longint;
a:array[0..20]of string;
b,l:array[0..20]of longint;
begin
readln(n);
for i:=1 to n do
begin
readln(a[i]);
l[i]:=length(a[i]);
b[i]:=i;
end;
for i:=1 to n-1 do
begin
for j:=i+1 to n do
begin
if (l[i]<l[j])or(l[i]=l[j])and(a[i]<a[j]) then
begin
a[0]:=a[i];a[i]:=a[j];a[j]:=a[0];
l[0]:=l[i];l[i]:=l[j];l[j]:=l[0];
b[0]:=b[i];b[i]:=b[j];b[j]:=b[0];
end;
end;
end;
writeln(b[1]);
write(a[1]);
end.