你的飞碟在这儿Your Ride Is He…

题目链接https://www.luogu.org/problemnew/show/P1200

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
char b[10],d[10];
int main()
{
	long long a=1,r=1;
	scanf("%s",&b);scanf("%s",&d);
	int f = strlen(b);
	int g = strlen(d);
	for(int i = 0;i < f ;i++)
	{
		a=a*(b[i]-'A'+1);
	} 
	for(int j = 0;j < g ;j++)
	{
		r=r*(d[j]-'A'+1);
	}
	if(a % 47 == r % 47 )
	{
		printf("GO\n");
	}
	else{
		printf("STAY\n");
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_43568078/article/details/84981796
he