We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c2791f commit 6e8a4daCopy full SHA for 6e8a4da
exercises/ex4.cpp
@@ -43,25 +43,25 @@ int insertNumber(){
43
44
do {
45
if(!isCorrect) cout << ERROR_COLOR+("[Insert a valid input] ")+NORMAL_COLOR;
46
-
+
47
cout << "Insert Mounth: ";
48
getline(cin, insert);
49
50
isCorrect = checkStringIsNumber(insert);
51
} while(!isCorrect);
52
53
return stoi(insert);
54
}
55
56
bool checkStringIsNumber(string in){
57
- if(in.empty())
+ if(in.empty())
58
return false;
59
60
for(int i = 0; i < in.size(); i++)
61
- if((in.at(i) < ZERO || in.at(i) > NINE) && in.at(i) != MINUS)
+ if((in.at(i) < ZERO || in.at(i) > NINE) && in.at(i) != MINUS)
62
63
64
if(stoi(in) > MAX_NUMBER) return false;
65
66
return true;
67
0 commit comments