
USACO第一题报错
源代码:{ID:这里我没写错PROG:rideLANG:PASCAL}programRide;vara,b:string;vari,numa,numb,sa,sb:lon...
源代码:
{
ID:这里我没写错
PROG:ride
LANG:PASCAL
}
program Ride;
var a,b:string;
var i,numa,numb,sa,sb:longint;
begin
Assign(input,'ride.in');
Reset(input);
Assign(output,'ride.out');
Reset(output);
readln(a);
readln(b);
sa:=length(a);
sb:=length(b);
numa:=1;
numb:=1;
for i:=1 to sa do
numa:=(ord(a[i])-64)*numa;
for i:=1 to sb do
numb:=(ord(b[i])-64)*numb;
numa:=numa mod 47;
numb:=numb mod 47;
writeln(numa,numb);
if numa=numb then
writeln('GO') else
writeln('STAY');
readln(sa);
Close(input);
Close(output);
end.
错误信息:
> Run 1: Execution error: Your program exited with exit status `2'.
Your program's exit status might indicate Pascal Runtime Error 2.
Here is the message for that Runtime Error:
File not found: You can get this error when you tried to do an
operation on a file which doesn't exist.
------ Data for Run 1 [length=14 bytes] ------
COMETQ
HVNGAT
----------------------------
Your program printed data to stdout. Here is the data:
-------------------
-------------------
Run time error 2: File not found: You can get this error when you
tried to do an operation on a file which doesn't exist.
-------------------
各位大神看看是怎么一回事啊。。程序没有错,结果也正确。。 展开
{
ID:这里我没写错
PROG:ride
LANG:PASCAL
}
program Ride;
var a,b:string;
var i,numa,numb,sa,sb:longint;
begin
Assign(input,'ride.in');
Reset(input);
Assign(output,'ride.out');
Reset(output);
readln(a);
readln(b);
sa:=length(a);
sb:=length(b);
numa:=1;
numb:=1;
for i:=1 to sa do
numa:=(ord(a[i])-64)*numa;
for i:=1 to sb do
numb:=(ord(b[i])-64)*numb;
numa:=numa mod 47;
numb:=numb mod 47;
writeln(numa,numb);
if numa=numb then
writeln('GO') else
writeln('STAY');
readln(sa);
Close(input);
Close(output);
end.
错误信息:
> Run 1: Execution error: Your program exited with exit status `2'.
Your program's exit status might indicate Pascal Runtime Error 2.
Here is the message for that Runtime Error:
File not found: You can get this error when you tried to do an
operation on a file which doesn't exist.
------ Data for Run 1 [length=14 bytes] ------
COMETQ
HVNGAT
----------------------------
Your program printed data to stdout. Here is the data:
-------------------
-------------------
Run time error 2: File not found: You can get this error when you
tried to do an operation on a file which doesn't exist.
-------------------
各位大神看看是怎么一回事啊。。程序没有错,结果也正确。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询