@newbie666
Заблокирован
|
23.04.2014, 23:06
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| std::string inputData;
std::cin >> inputData;
bool enteredSequenceIsANumber = true;
for(auto it = inputData.begin(); it != inputData.end(); it++)
{
if(!isdigit(*it))
{
enteredSequenceIsANumber = false;
break;
}
}
if(enteredSequenceIsANumber)
{
//Is a number -> continue...
int enteredNumber = atoi(inputData.c_str());
//Enjoy :-)
} |
|
0
|