讨论 / 各路大神帮忙纠错,语法错误...
东方幻想 2014-08-26 21:50:07
点我顶贴 收藏 删除
type student=record

nam:string;

qm:1..100;

py:1..100;

gb:string;

xb:string;

lw:0..10;

end;

var stu:array[1..100] of student;

n,i,hao:integer;

m:array[1..100] of integer;

sum,max:longint;

begin

readln(n);

for i:=1 to n do

begin

readln(stu[i].nam,stu[i].qm,stu[i].py,stu[i].gb,stu[i].xb,stu[i].lw);

end;

end.

begin

fillchar(m,sizeof(m),0);

for i:=1 to n do

begin

if (stu[i].qm>80) and (stu[i].lw>=1) then m[i]:=m[i]+8000;

if (stu[i].qm>85) and (stu[i].py>80) then m[i]:=m[i]+4000;

if (stu[i].qm>90) then m[i]:=m[i]+2000;

if (stu[i].qm>85) and (stu[i].xb='Y') then m[i]:=m[i]+1000;

if (stu[i].py>80) and (stu[i].gb='Y') then m[i]:=m[i]+850;

end;

end.

begin

sum:=0;

max:=0;

for i:=1 to n do

begin

sum:=sum+m[i];

end;

for i:=1 to n do

if m[i]>max then max:=m[i]; hao:=i;

writeln(stu[hao].nam);

writeln(m[hao]);

writeln(sum);

end.

#1 lyyzlxc@2015-04-22 06:37:04
回复 删除
6个月前的讨论,希望楼主可以看到,就是字符串不能和别的一起输入。
查看更多回复
提交回复