- 谁拿了最多奖学金
- 2009-06-13 18:26:01 @
program yy;
type
ming=string;
var
a:array[1..32767] of ming;
b,c,g,f:array[1..32767] of real;
d,e:array[1..32767] of char;
i,n,y,t:integer;
u:real;
begin
readln(n);
for i:=1 to n do read(a[i],b[i],c[i],d[i],e[i],f[i]);
u:=0;
for i:=1 to n do
begin
if (b[i]>80) and (f[i]>0) then u:=u+8000;
if (b[i]>85) and (c[i]>80) then u:=u+4000;
if b[i]>90 then t:=t+2000;
if (b[i]>80) and (e[i]='y') then u:=u+1000;
if (c[i]>80) and (d[i]='y') then u:=u+850;
g[i]:=u;
end;
y:=1;
t:=1;
for i:= 2 to n do
if g[i] > g[y] then y:=i;
if g[i] = g[y] then t:=t+1;
write(a[y],g[y],g[y]*t);
end.
能帮忙找出不能通过的原因吗?
1 条评论
-
强 LV 9 @ 2009-06-13 21:38:51
program a11;
var
n,i,scholar,max,nqm,nbp:integer;
totalscholar:longint;
nstr,maxstudent:string;
character:char;
begin
max:=0;
totalscholar:=0;readln(n);
for i:=1 to n do begin
nstr:='';
scholar:=0;repeat
read(character);
if character' ' then nstr:=nstr+character;
until character=' ';read(nqm,nbp);
if nqm>90 then scholar:=scholar+2000;
if (nqm>85)and(nbp>80) then scholar:=scholar+4000;read(character);read(character);
if (character='Y')and(nbp>80) then scholar:=scholar+850;
read(character);read(character);
if (character='Y')and(nqm>85) then scholar:=scholar+1000;
read(character);read(character);
if (character'0')and(nqm>80) then scholar:=scholar+8000;totalscholar:=totalscholar+scholar;
if scholar>max then begin
max:=scholar;
maxstudent:=nstr;
end;
end;writeln(maxstudent);
writeln(max);
writeln(totalscholar);
end.试试我的。
- 1