标签:
/* ID: modengd1 PROG: ride LANG: C++ */ #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream fout ("ride.out"); ifstream fin ("ride.in"); string S1,S2; int modS1,modS2; while(fin >> S1>>S2) { modS1=1;modS2=1; for(int i=0;i<S1.size();i++) modS1=(modS1*(S1[i]-‘A‘+1))%47; for(int i=0;i<S2.size();i++) modS2=(modS2*(S2[i]-‘A‘+1))%47; if(modS1==modS2) fout<<"GO"<<endl; else fout<<"STAY"<<endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/modengdubai/p/4758961.html