Hello again, I'm working on the kattis twostones problem for the cs1 class I started recently. It runs correctly and solves the problem, but when it prints it says 0Bob Wins! instead of just Bob Wins. any ideas as to why? thanks in advance.
/*
Take Two Stones
Kattis Practice
By: Andrew Libberton
9/7/2018
This program is designed to determine who would win in a game of stones where Alice and Bob choose a 2 consecutive stones two at a time
taking turns until there are no consecutive stones left. Both players play optimally. If there are an odd number of stones Alice wins
even number of stones Bob wins. Alice goes first and there are 1000000
1. Create integer representing the number of possible stones 1000000 : N
2. input the value the of N, (1 <= N <= 1000000)
3. Create if else statement to determine winner
4. Create an output to tell who wins
*/
#include <iostream>
#include <cmath>
#include <string>
#include <stdbool.h>
usingnamespace std;
int main() {
int N;
N = 0;
N = (1 <= N && N <= 10000000); //FIXME'<='; unsafe use of bool //fixed &&
if (N % 2 == 0) //fixed removed ;
cout << N << "Bob Wins!" << endl;
else //(N % 2 == 1); didn't fix // illegal else without matching if c2181 //fixed if
cout << N << "Alice Wins!" << endl;
cin.get(); //Fixed added ()
return 0;
}