Question: Integers are read from input and stored into a vector until 0 is read. Output the elements in the vector, replacing any elements greater than
Integers are read from input and stored into a vector until 0 is read. Output the elements in the vector, replacing any elements greater than the vector's last element with "IGNORE". End each number with a newline.
Ex: If the input is 3 -13 -2 -9 0, the vector's last element is -9. Thus, the output is:
IGNORE -13 IGNORE -9
--------------------------------------------------------------------------------------------
#include
#include
using namespace std;
int main() {
vector
int value;
int i;
cin >> value;
while (value != 0) {
numberVect.push_back(value);
cin >> value;
}
YOUR CODE GOES HERE!
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
