var
s:array[1..10]of string;
n,i,j,k,p,q:integer;
d:string;
a:array[1..10]of integer;
begin
assign(input,'gift1.in');
assign(output,'gift1.out');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do
begin
readln(d);
s:=d;
end;
for i:=1 to n do
begin
readln(d);
readln(p,q);
for j:=1 to n do
begin
if d=s[j]
then
begin
dec(a[j],p);
inc(a[j],(p-(p div q)*q));
break;
end;
end;
begin
readln(d);
for k:=1 to n do
begin
if d=s[k]
then
begin
inc(a[k],(p div q));
break;
end;
end;
end;
end;
for i:=1 to n do
writeln(s,' ',a);
close(input);
close(output)
end.
PASCAL的程序
编译没有问题
但是编译到那个 reset(input);
那里的时候 程序就出现因为exitcode=2而退出了
高手帮忙看看
USACO gift1......
|