大牛们,NOIP2005第一题,我知道很简单,可究竟哪错了?varn,i:integer;ch,monitor,west:char;na,k:string;max,total,s,paper,score1,score2:integer;beginread(n);for i:=1 to n dobegins:=0;na:='';read(ch);while(ch' ') dobeginna:=na+ch;read(ch);en
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 21:14:23
大牛们,NOIP2005第一题,我知道很简单,可究竟哪错了?varn,i:integer;ch,monitor,west:char;na,k:string;max,total,s,paper,score1,score2:integer;beginread(n);for i:=1 to n dobegins:=0;na:='';read(ch);while(ch' ') dobeginna:=na+ch;read(ch);en
大牛们,NOIP2005第一题,我知道很简单,可究竟哪错了?
var
n,i:integer;
ch,monitor,west:char;
na,k:string;
max,total,s,paper,score1,score2:integer;
begin
read(n);
for i:=1 to n do
begin
s:=0;
na:='';
read(ch);
while(ch' ') do
begin
na:=na+ch;
read(ch);
end;
read(score1);
read(score2);
read(ch);
read(monitor);
read(ch);
read(west);
readln(paper);
if (score1>80)and(paper>=1)then s:=s+8000;
if (score1>85)and(score2>80)then s:=s+4000;
if (score1>90)then s:=s+2000;
if (score1>85)and(west='Y')then s:=s+1000;
if (score2>80)and(monitor='Y')then s:=s+850;
if s>max then begin
max:=s;
k:=na;
end;
total:=total+s;
end;
writeln(k);
writeln(max);
writeln(total);
end.
大牛们,NOIP2005第一题,我知道很简单,可究竟哪错了?varn,i:integer;ch,monitor,west:char;na,k:string;max,total,s,paper,score1,score2:integer;beginread(n);for i:=1 to n dobegins:=0;na:='';read(ch);while(ch' ') dobeginna:=na+ch;read(ch);en
应该用长整型将integer换成longint;