P1200 [USACO1.1]你的飞碟在这儿Your Ride Is Here

题目传送门

#include<bits/stdc++.h>

using namespace std;
string a;
string b;

int main() {
    cin >> a >> b;

    int sum1 = 1;
    for (int i = 0; i < a.size(); i++)
        sum1 = sum1 * (a[i] - 64);//A-->1 则65-1=64

    int sum2 = 1;
    for (int i = 0; i < b.size(); i++)
        sum2 = sum2 * (b[i] - 64);

    if (sum1 % 47 == sum2 % 47) cout << "GO" << endl;
    else cout << "STAY" << endl;

    return 0;
}
posted @ 2021-11-18 10:42  糖豆爸爸  阅读(61)  评论(0编辑  收藏  举报
Live2D