|
@ -38,6 +38,7 @@ int* evaluateInput(char* input, int operation) { |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// formatting check of string |
|
|
bool containsTwoNumbers(const char* str) { |
|
|
bool containsTwoNumbers(const char* str) { |
|
|
int numbersCount = 0; |
|
|
int numbersCount = 0; |
|
|
bool hasSpace = false; |
|
|
bool hasSpace = false; |
|
@ -62,6 +63,7 @@ bool containsTwoNumbers(const char* str) { |
|
|
return (numbersCount == 2 && hasSpace); |
|
|
return (numbersCount == 2 && hasSpace); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// extracting of first number and removing from string |
|
|
int extractFirstNumber(char* str) { |
|
|
int extractFirstNumber(char* str) { |
|
|
int number = 0; |
|
|
int number = 0; |
|
|
bool isInNumber = false; |
|
|
bool isInNumber = false; |
|
|