noip2005-奖学金 2008.10.17

noip2005-奖学金 2008.10.17

program scholar;
const fin='scholar.in';fout='scholar.out';
var f1,f2:text;
    n,p,max,i,x1,x2,k,t,code,tot:longint;

    y1,y2,x,na,names:string;
begin
  assign(f1,fin);reset(f1);
  assign(f2,fout);rewrite(f2);
  readln(f1,n);max:=0;tot:=0;
  for i:=1 to n do
    begin
      readln(f1,x);p:=0;
      t:=pos(' ',x);
      na:=copy(x,1,t-1);
      x:=copy(x,t+1,length(x)-t);
      t:=pos(' ',x);
      val(copy(x,1,t-1),x1,code);
      x:=copy(x,t+1,length(x)-t);
      t:=pos(' ',x);
      val(copy(x,1,t-1),x2,code);
      x:=copy(x,t+1,length(x)-t);
      y1:=copy(x,1,1);y2:=copy(x,3,1);
      x:=copy(x,4,length(x)-3);
      val(x,k,code);
      if (x1>80)and(k>=1) then inc(p,8000);
      if (x1>85)and(x2>80) then inc(p,4000);
      if (x1>90) then inc(p,2000);
      if(x1>85)and(y2='Y')then inc(p,1000);
      if (x2>80)and(y1='Y') then inc(p,850);
      if p>max then begin max:=p;names:=na;end;
      inc(tot,p);
    end;
    writeln(f2,names);
    writeln(f2,max);
    writeln(f2,tot);
    close(f1);
    close(f2);
end.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值