AC哦!

pascal:
var
np,r :byte;
name1,name2:string;
name :array[1..10] of string;
m :array[1..10] of longint;
i,j,k,q :longint;
begin
readln(np);
for i:=1 to np do
readln(name[i]);
for i:=1 to np do
begin
readln(name1);

readln(q,r);

if r<>0 then

begin

for j:=1 to np do

if name[j]=name1 then m[j]:=m[j]+(q mod r)-q;

q:=q-(q mod r);

for j:=1 to r do

begin

readln(name2);

for k:=1 to np do

if name[k]=name2 then m[k]:=m[k]+q div r;

end;

end;
end;
for i:=1 to np do
writeln(name[i],' ',m[i]);
end.

3 条评论

  • 1

信息

ID
1035
难度
2
分类
模拟 点击显示
标签
(无)
递交数
5222
已通过
2901
通过率
56%
被复制
19
上传者