F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Expression

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 354    Accepted Submission(s): 80


Problem Description
As a shopkeeper of a restaurant,everyday ,dandelion's mother needs to calculate the incomes.Sometimes,she may make some mistakes.So dandelion wants you to write a program to help her calculate the value of some expressions.
You may consider every expression is made of :left parenthesis '(' ,right parenthesis ')' , plus sign '+' , subtraction sign '-' , multiplication sign '*' ,positive sign '+' ,and negative sign '-'.There is no precursor 0.The length of expression will not exceed 100.The value produced during the calculating will not exceed 10^9.Every expression is legal.Ie. ((10+(-100))) £¬-£¨-1£©£¬-3*(+5+7*2)-(0) £¬-0 £¬(-3)*(-5+7) are legal,while 1+-7 £¬--3+8 £¬-3+() are illegal.
 

Input
There are several cases,every line contains a expression.
 

Output
For every case ,print the answer of the expression.
 

Sample Input
-3*(+5-7*2)-(0)
 

Sample Output
27
 

Author
dandelion
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 22:17:06, Gzip enabled