challenge 1
Swipe to start coding
Implement a basic calculator that can evaluate a mathematical expression provided as a string input. The calculator should support the following operations: addition (+
), subtraction (-
), multiplication (*
), division (/
), and parentheses for grouping. The calculator should handle operator precedence correctly and be able to process expressions that include whitespace.
Examples
Input:
3 + 5 * 2 ^ 2
Output
23
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Resumir este capítulo
Explicar o código em file
Explicar por que file não resolve a tarefa
Awesome!
Completion rate improved to 50
challenge 1
Deslize para mostrar o menu
Swipe to start coding
Implement a basic calculator that can evaluate a mathematical expression provided as a string input. The calculator should support the following operations: addition (+
), subtraction (-
), multiplication (*
), division (/
), and parentheses for grouping. The calculator should handle operator precedence correctly and be able to process expressions that include whitespace.
Examples
Input:
3 + 5 * 2 ^ 2
Output
23
Obrigado pelo seu feedback!
Awesome!
Completion rate improved to 50single