I write this code and got pass in test.
The common mistake every one do in the beginnign is they actually put some helping text on cout to tell others what to do which is not needed.
#include <iostream>
using namespace std;
int main(){
int x=0;
cin >> x;
while(x != 42){
if (x <=99){
cout << x <<endl;
cin >> x;
}else {
cin >> x;
}
}
}