int main() { int temp; while (cin>>temp, !cin.eof()) { if (cin.bad()) { throw r
You didn't clear() the stream.