永发信息网

vijos 1001 pascal

答案:3  悬赏:40  手机版
解决时间 2021-06-07 09:30

money就是每个人的奖学金,wz是文章数量,qimo就是期末成绩,class是班级评议成绩

样例数据对了,我去提交只有30分

program p1001;
var n:longint;
name:array[1..100] of string;
money,wz,qimo,class:array[1..100] of longint;
west,gb:array[1..100] of char;

procedure inp;
var i,j:longint;
temp,k:string;
begin
readln(n);
for i:=1 to n do
begin
readln(temp);
while temp[1]<>' ' do
begin
name[i]:=name[i]+copy(temp,1,1);
delete(temp,1,1);
end;
delete(temp,1,1);
k:='';
while temp[1]<>' ' do
begin
k:=k+copy(temp,1,1);
delete(temp,1,1);
end;
val(k,qimo[i]);
k:='';
delete(temp,1,1);
while temp[1]<>' ' do
begin
k:=k+copy(temp,1,1);
delete(temp,1,1);
end;
val(k,class[i]);
k:='';
delete(temp,1,1);
gb[i]:=temp[1];
delete(temp,1,2);
west[i]:=temp[1];
delete(temp,1,2);
j:=0;
while (temp[1]<>' ') or (temp<>'') do
begin
k:=k+copy(temp,1,1);
delete(temp,1,1);
j:=j+1;
if j>2 then break;
end;
val(k,wz[i]);
end;
end;

procedure work;
var i,max,j:longint;
maxn:string;
begin
max:=0; maxn:=''; j:=0;
for i:=1 to n do
begin
if (wz[i]>=1) and (qimo[i]>80) then money[i]:=money[i]+8000;
if (qimo[i]>85) and (class[i]>80) then money[i]:=money[i]+4000;
if (qimo[i]>90) then money[i]:=money[i]+2000;
if (qimo[i]>85) and (west[i]='Y') then money[i]:=money[i]+1000;
if (qimo[i]>80) and (gb[i]='Y') then money[i]:=money[i]+850;
if money[i]>max then begin max:=money[i]; maxn:=name[i]; end;
end;
writeln(maxn);
writeln(max);
for i:=1 to n do j:=j+money[i];
writeln(j);
end;

begin
inp;
work;
end.

最佳答案
var
a,name:string;
comd:integer;
n,i,qm,bj,lw:longint;
gb,xb:char;
he:longint;
s,max:longint;
st:string;
j:longint;
begin
readln(n); he:=0;
for i:=1 to n do
begin
readln(st);
j:=pos(' ',st);
a:=copy(st,1,j-1); delete(st,1,j);
j:=pos(' ',st);
val(copy(st,1,j-1),qm,comd); delete(st,1,j);
j:=pos(' ',st);
val(copy(st,1,j-1),bj,comd); delete(st,1,j);
gb:=st[1];
xb:=st[3];
delete(st,1,4);
val(st,lw,comd);
s:=0;
if (qm>80) and (lw>=1) then s:=s+8000;
if (qm>85) and (bj>80) then s:=s+4000;
if qm>90 then s:=s+2000;
if (qm>85) and (xb='Y') then s:=s+1000;
if (bj>80) and (gb='Y') then s:=s+850;
he:=he+s;
if (s>max) or (i=1) then begin max:=s; name:=a; end;
end;
writeln(name);
writeln(max);
writeln(he);
end.
全部回答

我的

已经AC

program scholar; const fin='scholar.in'; fout='scholar.out'; var m,n,i,j,k,t,sum,p,max,q:longint; code:integer; st:string; s:array[0..101] of string; name:array[0..101] of string; a:array[0..101,0..6] of longint; begin readln(n); m:=0; q:=1; for i:=1 to n do begin readln(s[i]); for j:=1 to length(s[i]) do if s[i,j]=' ' then break; name[i]:=copy(s[i],1,j-1); delete(s[i],1,j); for j:=1 to length(s[i]) do if s[i,j]=' ' then break; st:=copy(s[i],1,j-1); val(st,a[i,1],code); delete(s[i],1,j); for j:=1 to length(s[i]) do if s[i,j]=' ' then break; st:=copy(s[i],1,j-1); val(st,a[i,2],code); delete(s[i],1,j); for j:=1 to length(s[i]) do if s[i,j]=' ' then break; st:=copy(s[i],1,j-1); if st='Y' then a[i,3]:=1 else a[i,3]:=0; delete(s[i],1,j); for j:=1 to length(s[i]) do if s[i,j]=' ' then break; st:=copy(s[i],1,j-1); if st='Y' then a[i,4]:=1 else a[i,4]:=0; delete(s[i],1,j); j:=length(s[i]); st:=copy(s[i],1,j); val(st,a[i,5],code); delete(s[i],1,j); if (a[i,1]>80) and (a[i,5]>0) then a[i,6]:=a[i,6]+8000; if (a[i,1]>85) and (a[i,2]>80) then a[i,6]:=a[i,6]+4000; if (a[i,1]>90) then a[i,6]:=a[i,6]+2000; if (a[i,1]>85) and (a[i,4]=1) then a[i,6]:=a[i,6]+1000; if (a[i,2]>80) and (a[i,3]=1) then a[i,6]:=a[i,6]+850; m:=m+a[i,6];sum:=sum+m; if m>max then begin max:=m; q:=i; end;m:=0; end; writeln(name[q]); writeln(max); writeln(sum); end.

aouvdbiqyrxlz你以上的一个语法错误,你自己观察。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
DNF EX改IMG时装问题、
当爱到了极限、会怎样?
雨花区长沙菜鸟驿站(民政学院中心花坛体育馆1
我想买一只股票谁能帮我推一只,你认为不错的
体彩机和手续三万五别人转让给我值吗
高手你们3D买什么啊!?
富阳到慈溪最早的一班车是下面时间的吗?
睡前脸洗后该抹面油吗?
民权县商丘五谷渔粉(东区店)地址是什么,有没
注册拍拍卖家输入财付通密码却显示不出密码
我头发有点发黄,发质比较软,天天洗头发用什
求经典失恋男人听的歌曲 要中文的
白羊座今年的爱情
急求c++员工信息设计(会的说话)
灼眼的夏娜好久出第三部
推荐资讯
谁知道黑涩会美眉的资料
火线为什么开不了图标
谁有三星S5200的照片给我?
勺子挖挖天,云彩下青山,南山下大雨,这里好
super junior和super junior-m的关系是怎么样
人贫血都有哪些症状?
Autocad2004破解版安装全过程,来个会注册的
1号来月经,16号同房,怀孕机遇有多大?
“子曰,由,诲汝知之乎,知之为知之,不知为
卡巴斯基反病毒软件2010怎样能更新至版本9.0.
谁知道还有那些比较好看的开场舞,比如像“篮
中专生三月份考试录取线一般在几分?
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?