#include <iostream> using std::cin; using std::cout; using std::endl; using std::cerr; int main() { int x; while(cin >> x && x != 42){ //pass } }