[edit] Previous post deleted.
Having re-read the question, I have a different take on what it means.
It appears that what is being asked is, from the input of: 1, 2, 88, 42, 99 - output must be each digit up until when 42 is typed, then no output from anything entered.
I now have a program that does that:
#include <iostream>
int main()
{
using std::cin;
using std::cout;
using std::endl;
int inputDigit;
for (int i = 0; i <= 10; i++)
{
cin >> inputDigit;
if (inputDigit != 42)
{
cout << endl << inputDigit;
}
else
{
return 0;
}
}
return 0;
}
It's messy, but it works. However, on submission I got "wrong answer". Blah!
-Oscarian
[edit] edited to save multiple posts.