#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a, b;
do{
while (1){
cout << "Please input two integers :";
cin >> a >> b;
if ((int)a != a || (int)b != b)
{
cout << "Aren't you input two integers,please try again" << endl;
continue;
}
else break;
}
if (a > b)
cout << "The larger number is " << a << endl;
else
cout << "The larger number is " << b << endl;
} while (a = b);
return 0;
}
执行之后如果输入的不是整数就会重复输出Please input two integers 与The larger number is
这是为啥
幕布斯7119047
慕侠2389804
慕沐林林