fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <utility>
  4. #include <set>
  5. using namespace std;
  6.  
  7. int main() {
  8. int n, i = 0;
  9. cin >> n;
  10. if(n <= 9){
  11. cout << "Stan wins.";
  12. return 0;
  13. }
  14. while(n % 2 != 1){
  15. n /= 2;
  16. i++;
  17. }
  18. if(i % 2 == 1){
  19. cout << "Ollie wins.";
  20. }
  21. else{
  22. cout << "Stan wins.";
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 4172KB
stdin
16
stdout
Stan wins.