【拾遗】检测cin输入是否满足类型

int a;
cin>>a;
if(cin.good())
{
    //输入正确
}
else
{
    //输入错误;
}


猜你喜欢

转载自blog.csdn.net/shihoongbo/article/details/49779309