首页 > 学院 > 开发设计 > 正文

谁拿了最多奖学金

2019-11-08 02:32:56
字体:
来源:转载
供稿:网友
var s:string; east,gb:array[0..100]of boolean; nam:array[0..100]of string; sum:array[1..100]of longint; a:array[0..100,1..2]of longint; l:array[0..100]of longint; i,j,n,max,ans,b:longint; maxs:string;begin readln(n); for i:=1 to n do begin  readln(s);  b:=pos(' ',s);  nam[i]:=copy(s,1,b-1);  delete(s,1,b);  b:=pos(' ',s);  val(copy(s,1,b-1),a[i,1]);  delete(s,1,b);  b:=pos(' ',s);  val(copy(s,1,b-1),a[i,2]);  delete(s,1,b);  if s[1]='Y' then gb[i]:=true;  if s[1]='N' then gb[i]:=false;  delete(s,1,2);  if s[1]='Y' then east[i]:=true;  if s[1]='N' then east[i]:=false;  delete(s,1,2);  val(copy(s,1,2),l[i]); end; for i:=1 to n do begin  if (a[i,1]>80)and(l[i]>=1) then sum[i]:=sum[i]+8000;  if (a[i,1]>85)and(a[i,2]>80) then sum[i]:=sum[i]+4000;  if (a[i,1]>90) then sum[i]:=sum[i]+2000;  if (a[i,1]>85)and(east[i]) then sum[i]:=sum[i]+1000;  if (a[i,2]>80)and(gb[i]) then sum[i]:=sum[i]+850; end; maxs:=''; max:=-1; for i:=1 to n do begin  ans:=ans+sum[i];  if sum[i]>max then begin max:=sum[i]; maxs:=nam[i]; end; end; writeln(maxs); writeln(max); write(ans);end.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表