USACO第一道题
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/25 23:31:49
USACO第一道题
模拟的水题……
{
ID:mrexcel1
LANG:PASCAL
TASK:ride
}
var
s,s1,i,l,l1:longint;
a,b:string;
begin
readln(a);
readln(b);
s2:=1;
s1:=1;
l:=length(a);
l1:=length(b);
for i:=1 to l do
s:=s*(ord(a[i])-64);
for i:=1 to l1 do
s1:=s1*(ord(b[i])-64);
if (s mod 47)=(s1 mod 47) then
writeln('GO')
else writeln('STAY');
end.
{
ID:mrexcel1
LANG:PASCAL
TASK:ride
}
var
s,s1,i,l,l1:longint;
a,b:string;
begin
readln(a);
readln(b);
s2:=1;
s1:=1;
l:=length(a);
l1:=length(b);
for i:=1 to l do
s:=s*(ord(a[i])-64);
for i:=1 to l1 do
s1:=s1*(ord(b[i])-64);
if (s mod 47)=(s1 mod 47) then
writeln('GO')
else writeln('STAY');
end.