Problem list
Log in
#r00053 · 주몽이(original)

계산 하는 문제 3

Gold V 1.0 s 256 MB

길이 $n$의 문자열이 주어진다. 이 문자열의 계산 결과를 예제와 같이 출력한다.

Input

길이 100 이하의 문자열이 주어진다. 이 문자열은 정수, +, -, (, ), * 만으로 이루어진다. (,)의 우선순위가 가장 높고, *의 우선순위가 그 다음이다.

Output

이 문자열의 계산 결과를 출력한다.

Constraints

$-10000 ≤$ 결과 $≤ 10000$, $-100 ≤$ 문자열의 정수 $≤ 100$

Example 1

Input
1+2*3
Output
7

Example 2

Input
(1+2)*3
Output
9

Example 3

Input
3*(1+(1+2*7)*33)+4
Output
1492
Source
주몽이(original) by joomongogo
Appears in
Not part of a ladder, contest or set yet.
Accepted 6 Submissions 7 Acceptance 100% Solvers 6

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code