O(n)用字符串比较两个数字。(1)长度长的数字一定大。(2)如果长度相同,直接两个字符串比较。var i,j,n:longint; s,a:string;begin readln(n); readln(a); j:=1; for i:=2 to n do begin readln(s); if length(s)>length(a) then begin a:=s;j:=i;end else if length(s)=length(a) then if s>a then begin a:=s;j:=i;end; end; writeln(j); writeln(a);end.