题目: |
Var
S:string;
i:integer;
m1,m2:char;
begin
readln(s);
n1:= ‘ ‘;
m2:=’ ‘;
for i:=1 to length(s) do
if s[i] > m1 then
begin
m2:=m1;
m1:=s[i];
end
else if s[i] > m2 then
m2:=s[i];
writeln(ord(m1), ‘ ‘, ord(m2));
end.
输入:Expo 2010 Shanchai China 输出:120 112
|