Evaluate expression


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C#, Go, Java

Donat un String amb una expressió aritmètica de sumes i multiplicacions, avaluar el seu resultat.

Input Format

Un string amb una expressió aritmètica de sumes i multiplicacions enteres.

Constraints

No hi ha

Output Format

El resultat de l'expressió

Test Case 1

Input
1
Output
1

Test Case 2

Input
2+2
Output
4

Test Case 3

Input
2+2+2
Output
6

Test Case 4

Input
2*2
Output
4

Test Case 5

Input
2*2*2
Output
8

Test Case 6

Input
2+3*4
Output
14

Test Case 7

Input
2*3+4
Output
10

Test Case 8

Input
2*3+4*5
Output
26

Test Case 9

Input
2+3*4+5
Output
19

Test Case 10

Input
2+10*1+1*100
Output
112

Test Case 11

Input
123*456+789*123+456*789
Output
512919

Authorship: Gerard Falcó

CC BY-NC-SA 4.0