- 谁拿了最多奖学金
- 2012-08-06 16:50:45 @
我记录用了错了不用,字符串用了错了不用,都一个一个字符判断了怎么还错,大神帮忙改错啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
program ss;
var i,j,k,n,all,bestnumber,bestmoney,r,a,b,p:integer;
exam,class,word:array[1..100]of integer;
cadre,west:array[1..100]of char;
tl:char;
s:array[1..100,1..20]of string;
jj:array[1..100]of integer;
str:string;
money:array[1..100]of longint;
begin
readln(n);
{---|---|---|---|---|---|手动读入---|---|---|---|---|---|}
for i:=1 to n do
begin
readln(str);
j:=1;
while str[j]' ' do
begin
s:=str[j];
j:=j+1;
end;
jj[i]:=j;
j:=j+1;
a:=0;
while str[j]' ' do
begin
b:=ord(str[j])-ord('0');
a:=a*10+b;
j:=j+1;
end;
exam[i]:=a;
j:=j+1; a:=0;
while str[j]' ' do
begin
b:=ord(str[j])-ord('0');
a:=a*10+b;
j:=j+1;
end;
class[i]:=a;
cadre[i]:=str[j+1];
west[i]:=str[j+3];
word[i]:=ord(str[j+5])-ord('0');
end;
{---|---|---|---|---|---|---|---|---|---|---|---|---|---|-}
bestnumber:=0; bestmoney:=0;
for k:=1 to n do
begin
money[k]:=0;
if ((exam[k]>80) and (word[k]>=1)) then money[k]:=money[k]+8000;
if ((exam[k]>85) and (class[k]>80)) then money[k]:=money[k]+4000;
if (exam[k]>90) then money[k]:=money[j]+2000;
if ((exam[k]>85) and (west[k]='Y')) then money[k]:=money[k]+1000;
if ((class[k]>80) and (cadre[k]='Y'))then money[k]:=money[k]+850;
if money[k]>bestmoney then begin
bestnumber:=k; bestmoney:=money[k];
end;
all:=all+money[k];
end;
{---|---|---|---|---|---|---|---|---|---|---|---|---|---|}
for p:=1 to jj[bestnumber] do write(s[bestnumber,p]);
writeln;
writeln(money[bestnumber]);
writeln(all);
end.