-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.cpp
More file actions
46 lines (46 loc) · 978 Bytes
/
Copy patha.cpp
File metadata and controls
46 lines (46 loc) · 978 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
45
46
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,p,cnt;
while(cin >> n)
{
if(n==1)
cout <<"Stan Wins.\n";
else if(n%2==0)
{
for(int i = 2; i <= 9; i++)
{
p = 1;
cnt = 0;
while(p>=n)
{
cnt++;
p*=i;
}
}
if(cnt%3==0)
cout << "Stan Wins.\n";
else
cout << "Ollie Wins.\n";
}
else if(n&1)
{
for(int i = 2; i <= 9; i++)
{
p = 1;
cnt = 0;
while(p>=n)
{
cnt++;
p*=i;
}
}
if(cnt%2==0)
cout << "Ollie Wins.\n";
else
cout << "Stan Wins.\n";
}
}
return 0;
}