From 3bb7f2693e288cf758e3b9dd431bce56a9ec3ab5 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 17 Dec 2021 21:36:04 +0800 Subject: [PATCH] Your Ride Is Here --- USACO-Training/1.2/2/2.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 USACO-Training/1.2/2/2.cpp diff --git a/USACO-Training/1.2/2/2.cpp b/USACO-Training/1.2/2/2.cpp new file mode 100644 index 00000000..0e3a813d --- /dev/null +++ b/USACO-Training/1.2/2/2.cpp @@ -0,0 +1,36 @@ +/* +ID: baoshuo1 +PROG: ride +LANG: C++ +*/ + +#include +#include +#include + +using namespace std; + +int main() { + freopen("ride.in", "r", stdin); + freopen("ride.out", "w", stdout); + int us = 1, zs = 1; + string a, b; + getline(cin, a); + getline(cin, b); + for (int i = 0; i < 7; i++) { + if (a[i] <= 0) break; + us *= a[i] - 64; + } + for (int i = 0; i < 7; i++) { + if (b[i] <= 0) break; + zs *= b[i] - '@'; + } + us %= 47; + zs %= 47; + if (us == zs) { + cout << "GO" << endl; + } else { + cout << "STAY" << endl; + } + return 0; +}