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 numberVect;

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!