USACO中 Your Ride Is Here一题错在哪了?
{
ID:sunligh2
PROB:Your Ride Is Here
LANG:PASCAL
}
PROGRAM Your_Ride_Is_Here;
CONST
finn='ride.in';
foutn='ride.out';
num:array['A'..'Z']of integer=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,
18,19,20,21,22,23,24,25,26);
VAR
s:string;
m,n,ii,t:longint;
BEGIN
assign(input,finn);
reset(input);
readln(s);
m:=1;
for ii:=1 to length(s) do
m:=m*num[s[ii]];
readln(s);
close(input);
n:=1;
for ii:=1 to length(s) do
n:=n*num[s[ii]];
if m>n then t:=m-n
else t:=n-m;
t:=t mod 47;
assign(output,foutn);
rewrite(output);
if t=0 then writeln('GO')
else writeln('STAY');
close(output)
end.