-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathride.cpp
More file actions
44 lines (37 loc) · 712 Bytes
/
ride.cpp
File metadata and controls
44 lines (37 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
ID: thejoke2
LANG: C++
TASK: ride
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
//A=65
int main()
{
ofstream fout ("ride.out");
ifstream fin ("ride.in");
string group = "";
fin >> group;
string comet = "";
fin >> comet;
int groupnum=1, cometnum=1;
for (int i = 0 ; i < group.length() ; i++)
{
groupnum*=(int(group[i])-64);
}
for (int i = 0 ; i < comet.length() ; i++)
{
cometnum*=(int(comet[i])-64);
}
if ( (groupnum%47) == (cometnum%47) )
{
fout << "GO" << endl;
}
else
{
fout << "STAY" << endl;
}
return 0;
}