#include #include using namespace std; int main() { int i; while (cin >> i) { //while (cin.operator>>(i).operator void *()) { cout << i << "\n"; //operator<<(cout.operator<<(i), "\n"); } cout << "cin.eof() == " << cin.eof() << "\n" << "cin.bad() == " << cin.bad() << "\n" << "cin.fail() == " << cin.fail() << "\n"; return cin.rdstate() == (ios_base::eofbit | ios_base::failbit) ? EXIT_SUCCESS : EXIT_FAILURE; }