PersonalCorpus 版 (精华区)
152663 05:18:38 3 Mar 2002
Bozhang,HIT,P.R.China 1179 Pascal Accepted 0.751 sec 49K
var
sum:array[1..35] of integer;
flag:array[1..35] of boolean;
c:char;
i,j:integer;
begin
fillchar(sum,sizeof(sum),0);
fillchar(flag,sizeof(flag),0);
while not eof(input) do begin
while eoln(input) do begin readln; if eof(input) then break end;
if eof(input) then break;
while not (eoln(input) or eof(input)) do begin
read(c);
if (c>='0') and (c<='9') then j:=ord(c)-48 else j:=ord(c)-55;
if j=0 then j:=1;
for i:=j to 35 do if not flag[i] then flag[i]:=true;
for i:=1 to j-1 do if flag[i] then begin inc(sum[i]); flag[i]:=f
alse end;
end;
for i:=1 to 35 do if flag[i] then begin inc(sum[i]); flag[i]:=false
end;
end;
j:=1; for i:=2 to 35 do if sum[i]>sum[j] then j:=i;
writeln(j+1,' ',sum[j]);
end.
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.047毫秒