不解释了..
/*
LANG: C
ID: zqynux11
PROG: ride
*/
#include <stdio.h>
#define loop(i, j)\
p = i;\
while(*p != '\0'){\
j *= *p - 'A' + 1;\
p++;\
}/* 之前将p++掉了.. */
int main(void)
{
char ufo[7], name[7];
char *p;
int a = 1, b = 1;
freopen("ride.in", "r", stdin);
freopen("ride.out", "w", stdout);
gets(ufo);
gets(name);
loop(ufo, a);
loop(name, b);
if(a % 47 == b % 47){
puts("GO");
}else{
puts("STAY");
}
return 0;
}