xiaoyangr32 2013-01-30 19:42:00
点我顶贴
收藏
删除
谁能告诉我怎会么会出这种问题?关于“谁拿了最多奖学金”
program pl;
var s,b,c,f,m:array[1..100] of integer;{s是总和,b是成绩,c是班议,f是发表论文篇数}
a,d,e:array[1..100] of string;{a是姓名,d是是否西藏,e是是否班干部}
n,i,j,t,l:integer;
begin
read(n);
for i:=1 to n do
read(a[i],b[i],c[i],d[i],e[i],f[i]);{读入数据}
for i:=1 to n do
begin
if (b[i]>80) and (f[i]>=1) then s[i]:=s[i]+8000;
if (b[i]>85) and (c[i]>80) then s[i]:=s[i]+4000;
if (b[i]>90) then s[i]:=s[i]+2000;
if (b[i]>85) and (d[i]='y') then s[i]:=s[i]+1000;
if (c[i]>80) and (e[i]='y') then s[i]:=s[i]+850;
m[i]:=s[i];
end;
for i:= 1 to n do
begin
for j:= 1 to n do
if (s[j]>s[j+1]) then
begin
t:=s[j];
s[j]:=s[j+1];
s[j+1]:=t;
end;
end;
for i:=1 to n do
if (m[i]=s[1]) then begin writeln(a[i]);writeln(m[i]); end;
for i:=1 to n do
l:=l+s[i];
writeln(l);
end.
好像是因为输入有问题