```cpp
var s,t:string;
i,k,l:longint;
begin
readln(s);readln(t);
k:=1;l:=1;
for i:=1 to length(s) do l:=l*(ord(s[i])-64);
for i:=1 to length(t) do k:=k*(ord(t[i])-64);
if (l mod 47)=(k mod 47) then
writeln('GO') else writeln('STAY');
end.
```
by 20030103pz @ 2016-08-17 19:54:29
很简单的字符串
by 20030103pz @ 2016-08-17 19:56:46
关键在于把字符变成数字
by 20030103pz @ 2016-08-17 19:58:23
```cpp
var st1,st2:string;
p,q:int64;
i:longint;
begin
p:=1;
q:=1;
readln(st1);
readln(st2);
for i:=1 to length(st1) do
p:=p*(ord(st1[i])-ord('A')+1);
for i:=1 to length(st2) do
q:=q*(ord(st2[i])-ord('A')+1);
if p mod 47=q mod 47 then writeln('GO')
else writeln('STAY');
end.
```
by chongchong @ 2016-08-21 15:18:13
```cpp
var a,b:string; c1,c2:int64; i:byte;
begin
readln(a);
readln(b);
c1:=1;
c2:=1;
for i:=1 to length(a) do c1:=c1*((ord(a[i]))-64);
for i:=1 to length(b) do c2:=c2*((ord(b[i]))-64);
if c1 mod 47=c2 mod 47 then writeln('GO') else writeln('STAY');
end.
```
by 未见堇开 @ 2016-09-17 09:55:25
字符转数字 先把字符转成它的ASCII码{((ord(a[i]))},再减64,(\_\_一个很奇葩的符号**‘像一条蛇’**O(∩\_∩)O~~\_\_>) \_{\_((ord(a[i]))-64\_}\_。
by zzy2005 @ 2016-10-11 22:15:51