Fixed code not computing the special operation properly

This commit is contained in:
2026-04-01 23:19:40 +03:00
parent d4790dfc4e
commit eb7e3391c2
+3 -3
View File
@@ -47,10 +47,10 @@ ValidationResult validate_token(const std::string &token)
if (digitpos == -1) if (digitpos == -1)
return {true, ' ', 0}; return {true, token[0], 0};
int next = stoi(token.substr(digitpos)); int next = stoi(token.substr(digitpos));
return {true, ' ', next}; return {true, token[0], next};
} }
Command resolveCommand() Command resolveCommand()
@@ -72,7 +72,7 @@ Command resolveCommand()
for (const char c: token) for (const char c: token)
{ {
static const std::string operators {"+-*/%"}; static const std::string operators {"+-*/%$"};
if(operators.find(c) != operators.npos) if(operators.find(c) != operators.npos)
{ {
operation = c; operation = c;