LANG: C++ */ #include<iostream> #include<cstring> #include<fstream> using namespace std; int main(int argc,char** argv) { string comet; string group; unsigned long cometresult=1; unsigned long groupresult=1; ifstream infile; infile.open("ride.in"); //imput infile>>comet; infile>>group; infile.close(); ofstream outfile; outfile.open("ride.out"); //compute int csize = comet.size(); int gsize = group.size(); for(int i=0;i<csize;i++) cometresult *= comet.at(i)-'A'+1; for(int i=0;i<gsize;i++) groupresult *= group.at(i)-'A'+1; if((cometresult%47)==(groupresult%47)) outfile<<"GO"<<endl; else outfile<<"STAY"<<endl; outfile.close(); return 0;
USER: li weijian [lwj13961] TASK: ride LANG: C++ Compiling... Compile: OK Executing... Test 1: TEST OK [0.011 secs, 2844 KB] Test 2: TEST OK [0.000 secs, 2844 KB] Test 3: TEST OK [0.011 secs, 2840 KB] Test 4: TEST OK [0.011 secs, 2840 KB] Test 5: TEST OK [0.011 secs, 2844 KB] Test 6: TEST OK [0.000 secs, 2840 KB] Test 7: TEST OK [0.000 secs, 2840 KB] Test 8: TEST OK [0.000 secs, 2840 KB] Test 9: TEST OK [0.000 secs, 2840 KB] Test 10: TEST OK [0.000 secs, 2840 KB] All tests OK.
Your program ('ride') produced all correct answers! This is your submission #5 for this problem. Congratulations!