参考资料:http://topic.csdn.net/u/20100308/23/a8bed6df-b742-4042-a8d0-86d277ba1ab4.html
http://topic.csdn.net/t/20050216/20/3786253.html
举例:
#include <iostream.h>
int main()
{
char inb = 0;
while(1)
{
// cin >> inb;
// if(inb == '\r') continue;
// if(inb == '!') break;
//istream::getline(cin, inb);
cin.get(inb);
if(inb == '\n')
continue;
if(inb == '!')
break;
cout<<"again"<<endl;
}
return 0;
}