唉,吐血了,居然因为最后忘了做清0处理导致UAC了N多次,可怜我的通过率就这么毁了
贴一下代码纪念一下
Program P1001;
Var rs,i,gr,bj,lw:integer;
stu,maxname:string;
a,gb,xb:char;
t,max,all:longint;
begin
readln(rs);
for i:=1 to rs do
begin
read(a);
while a<>' ' do
begin
stu:=stu+a;
read(a);
end;
read(gr,bj);
read(gb);read(gb);
read(xb);read(xb);
read(lw);
if (gr>80) and (lw>=1) then t:=8000;
if (gr>85) and (bj>80) then t:=t+4000;
if gr>90 then t:=t+2000;
if (gr>85) and (xb='Y') then t:=t+1000;
if (bj>80) and (gb='Y') then t:=t+850;
if t>max then
begin
max:=t;
maxname:=stu;
end;
all:=all+t;
t:=0;
stu:='';
end;
writeln(maxname);
writeln(max);
writeln(all);
end.
原题链接:http://www.vijos.cn/Problem_Show.asp?id=1001
没有评论:
发表评论