洛谷P1022 [USACO1.1]你的飞碟在这儿Your Ride Is Here
题目描述
详见洛谷
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char a[100],b[100];
int x[100]={0},y[100]={0},i=1,j=1;
cin>>a>>b;
for(int t=0;t<strlen(a);t++)
{
i*=(int)a[t]-'A'+1;
}
for(int t=0;t<strlen(b);t++)
{
j*=(int)b[t]-'A'+1;
}
if(i%47==j%47)
{
cout<<"GO";
}
else
{
cout<<"STAY";
}
return 0;
}