#include <sstream>
#include <iostream>
using namespace std;
main()
{
cin.exceptions(iostream::failbit);
int i;
try
{
while(!cin.eof())
{
cin>>i;
cerr << i<<endl;
i+=i;
}
}
catch(iostream::failure e)
{
cout <<e.what() << endl;
}
cerr << i << endl;
}
почему на C-d вылитает по exceptin?