@David Sylva
1291 / 953 / 51
Регистрация: 17.05.2012
Сообщений: 2,687
|
02.07.2012, 19:26
|
|
Можно вот так сделать
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| #include <iostream>
using namespace std;
int main()
{
setlocale(0, "rus");
int number;
while(true)
{
cout << "Введите число " << endl;
cin >> number;
if(cin.good())
{
cin.ignore(10, '\n');
break;
}
cin.clear();
cout << "Неправильный ввод " << endl;
cin.ignore(10, '\n');
}
cout << "Число " << number << endl;
} |
|
0
|