- 谁拿了最多奖学金
- 2009-08-03 19:58:13 @
program jxj;
var
s,m,bgb,xb,mz:string;
qm,pj,lw,i,max,h,n:integer;
z:array[1..100] of longint;
procedure doing(s:string);
var
i,o,l:longint;
a:array[1..2000] of integer;
begin
o:=0;
fillchar(a,sizeof(a),0);
l:=length(s);
for i:=1 to l do
if s[i]=' ' then begin
inc(o);
a[o]:=i;
end;
m:=copy(s,1,a[1]-1);
val(copy(s,a[1]+1,a[2]-a[1]-1),qm);
val(copy(s,a[2]+1,a[3]-a[2]-1),pj);
bgb:=s[a[3]+1];
xb:=s[a[4]+1];
val(copy(s,a[5]+1,l-a[5]),lw);
end;
begin
readln(n);
for i:=1 to n do
begin
readln(s);
doing(s);
if (qm>80) and (lw>=1) then z[i]:=z[i]+8000;
if (qm>85) and (pj>80) then z[i]:=z[i]+4000;
if qm>90 then z[i]:=z[i]+2000;
if (qm>85) and (xb='Y') then z[i]:=z[i]+1000;
if (pj>80) and (bgb='Y') then z[i]:=z[i]+850;
h:=h+z[i];
if z[i]>max then begin
max:=z[i];
mz:=m;
end;
end;
writeln(mz);
writeln(max);
write(h);
end.
可能读书处理麻烦些
问 为什longint用integer一个也过不了 结果都是错的 还有负的
1 条评论
-
YY_0227 LV 8 @ 2009-08-04 10:44:06
好厉害
我五年级就A了
- 1