/* * read list of ints * output whether list contains all even, all odd, or neither. * input begins with an int indicating the number of ints in the list * * input: * 5 2 4 6 8 10 * * output: * all even * * input: * 5 1 -3 5 -7 9 * * output: * all odd * * input: * 5 1 2 3 4 5 * * output: * not even or odd * * Two functions * * bool IsVectorEven(vector myVec) * bool IsVectorOdd(vector myVec) */ #include #include using namespace std; /* Define your function here */ bool IsVectorEven(vector myVec) { for (int i=0;i myVec) { for (int i=0;i> length; vector listOfNums; for (int i=0;i> input; listOfNums.push_back(input); } if (IsVectorEven(listOfNums)){ cout << "all even" << endl; } else if (IsVectorOdd(listOfNums)){ cout << "all odd" << endl; } else{ cout << "not even or odd" << endl; } return 0; }