Question: Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop that outputs each element in numbersList

 Integer numElements is read from input. Then numElements integers are read

Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop that outputs each element in numbersList that is divisible by 9, and adds 1 to each divisible by 9 element. End each output with " is corrected to a number not divisible by 9" followed by a newline.

Ex: If the input is 3 36 54 23, then the output is:

Original numbers: 36 54 23

36 is corrected to a number not divisible by 9

54 is corrected to a number not divisible by 9

Nearest numbers not divisible by 9: 37 55 23

-----------------------------------------------------------------------------------------------------------

#include #include using namespace std;

int main() { int numElements; unsigned int i; vector numbersList; cin >> numElements; numbersList.resize(numElements); for (i = 0; i > numbersList.at(i); } cout

\\ Enter Your Code Here in C++ (Thank you!)

cout Integer numElements is read from input. Then numElements integers are read and stored in vector numbersList. Write a loop tha outputs each element in numbersList that is divisible by 9 , and adds 1 to each divisible by 9 element. End each output with " is corrected to a number not divisible by 9" followed by a newline. Ex: If the input is 3365423 , then the output is: Original numbers: 365423 36 is corrected to a number not divisible by 9 54 is corrected to a number not divisible by 9 Nearest numbers not divisible by 9: 375523

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!