- 谁拿了最多奖学金
- 2009-08-19 14:57:12 @
program aa;
var
s1,s2:string;
s:array[0..1000]of string;
e:array[0..1000]of integer;
a,c,b,f,t,n,x,d,k:integer;
i,j:char;
begin
readln(n);
for x:=1 to n do
begin
readln(s1);
while s1' ' do
begin
b:=b+1;
s[x]:=s[x]+s1;
end;
b:=b+1;
while s1' ' do
begin
a:=ord(s1)-48+a*10;
b:=b+1;
end;
b:=b+1;
while s1' ' do
begin
c:=ord(s1)-48+c*10;
b:=b+1;
end;
b:=b+1;
i:=s1;
b:=b+2;
j:=s1;
b:=b+2;
d:=ord(s1)-48+d*10;
if (a>80) and (d>=1) then e[x]:=e[x]+8000;
if (a>85) and (c>80) then e[x]:=e[x]+4000;
if a>90 then e[x]:=e[x]+2000;
if (a>85) and (j='Y') then e[x]:=e[x]+1000;
if (c>80) and (i='Y') then e[x]:=e[x]+850;
b:=0;
a:=0;
c:=0;
d:=0;
k:=k+e[x];
end;
for x:=1 to n do
if e[x]>f then
begin
f:=e[x];
s2:=s[x];
end;
writeln(s2);
writeln(f);
write(k);
end.
到底哪里错了,还请大家帮我看看!
3 条评论
-
2942216lby LV 4 @ 2009-08-22 12:34:41
弄不懂
-
2009-08-21 21:54:20@
我也0分YEAH!!
program scholar;
var
name:array[1..100]of string;
ave,cla,money:array[1..100]of integer;
bg,bw,m:char;
ss:char;
b1,b2,b3:array[1..100]of byte;
n,i,j,Sum,max,po:integer;
begin
fillchar(b1,sizeof(b1),0);
fillchar(b2,sizeof(b2),0);
fillchar(b3,sizeof(b3),0);
fillchar(money,sizeof(money),0);
Sum:=0;
max:=0;
readln(n);
for i:=1 to n do
begin
repeat
read(ss);
name[i]:=name[i]+ss;
until ss=' ';
read(ave[i],cla[i]);
read(ss);read(ss);
if ss='Y' then b1[i]:=1;
read(ss);read(ss);
if ss='Y' then b2[i]:=1;
read(ss);read(ss);
if (ss'0') then b3[i]:=1;
readln;
end;for i:=1 to n do
begin
if (ave[i]>80) and (b3[i]=1) then money[i]:=money[i]+8000;
if (ave[i]>85) and (cla[i]>80) then money[i]:=money[i]+4000;
if (ave[i]>90) then money[i]:=money[i]+2000;
if (ave[i]>85) and (b2[i]=1) then money[i]:=money[i]+1000;
if (cla[i]>80) and (b1[i]=1) then money[i]:=money[i]+850;
Sum:=Sum+money[i];
if money[i]>max then
begin
max:=money[i];
po:=i;
end;
end;
writeln(name[po]);
writeln(max);
writeln(Sum);
end. -
2009-08-19 15:57:55@
你的s1应定为char类型
- 1