回分類題庫
d218: CP2 Lab Exercise: Back To Back To Romance's Romance
出處:

Difficulity : N/A
Accepted : 55 Times | Submit :200 Times | Clicks : 1408
Accepted : 35 Users | Submit : 37 Users | Accepted rate : 95%
Time Limit :10000 ms | Memory Limit : 64000 KBytes
題目加入時間 : 2011-04-06 15:24

Content :

Given a stack.h and stack.o, (Yes, they are received from TA), please help BTR to write a program to check if the parentheses are balanced or not.

Input :

Each line is a set of test data, which is a tradition math expression.

(Consist of : numbers, +, -, *, /, (, ), [, ], {, }   )

Output :

For each test data output a line "AC" if the expression is balanced; "WA", otherwise.

Sample Input :

{[2*(2+3)]*3+3}
{[2*(2+3)]*3+3

Sample Output :

AC
WA

Hint :


  

Author :


  Solve it!   Status Forum (0)

C++
C
JAVA
49499. CC501 (6 ms , 222KB)
76758. alun0922 (8 ms , 394KB)
56102. ag100 (2 ms , 242KB)
31272. cp99703009 (2 ms , 232KB)
31260. ayakamuxin (2 ms , 236KB)
31259. cp99703024 (2 ms , 238KB)
31040. nothinglo (2 ms , 208KB)
55552. nwgs524513cja (104 ms , 172KB)

執行時間會受很多因素影響因此僅供參考,主機等級請看這裡