/* Name: Brennen Cox
Project: A3C1P1
Description: Stating who wins the even odd game.*/
#include <iostream>
using namespace std;
int main()
{
int p1, p2, total, total1;
cout << "Press return after entering a answer.\n";
cout << "Player1 please enter a number 1-5:";
cin >> p1;
if (p1<1 or p1>5){
cout<< "The value entered by Player1, "<< p1 << ", must be between 1 and 5.\n";
return 0;
}
cout << "Player2 please enter a number 1-5:";
cin >> p2;
if (p2<1 or p2>5){
cout<< "The value entered by Player2, "<< p2 << ", must be between 1 and 5.\n";
return 0;
}
total1 = (p1+p2);
total= total1%2;
if (total == 0)
cout<< "The sum, "<< total1 <<", is even so Player1 wins.\n";
else
cout<< "The sum, "<< total1 <<", is odd so Player2 wins.\n";
return 0;
}