d984.
棄保效應
--
板橋高中教學題
| From: [218.242.227.162] |
發表日期
:
2013-12-07 11:29
const
s='ABC';
var
a:array[1..3] of longint;
ab:array[1..3] of longint;
i,j:longint;
max,mid,min:longint;
temp:longint;
posmin,posmid:longint;
begin
while not eof do
begin
fillchar(a,sizeof(a),0);
fillchar(ab,sizeof(ab),0);
for i:=1 to 3 do
read(a[i]);
for i:=1 to 3 do
ab[i]:=a[i];
for i:=1 to 2 do
for j:=3 downto i+1 do
if ab[j-1]>ab[j] then
begin
temp:=ab[j-1];
ab[j-1]:=ab[j];
ab[j]:=temp;
end;
max:=ab[3];
mid:=ab[2];
min:=ab[1];
for i:=1 to 3 do
begin
if a[i]=min then posmin:=i;
if a[i]=mid then posmid:=i;
end;
a[posmid]:=a[posmid]+a[posmin];
a[posmin]:=0;
if max<a[posmid] then max:=a[posmid];
for i:=1 to 3 do
if max=a[i] then begin
writeln(s[i]);
break;
end;
end;
end.