括号匹配
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
假设表达式中允许包含圆括号和方括号两种括号,其嵌套的顺序随意,如([]())或[([][])]等为正确的匹配,[(])或([]()或(()))均为错误的匹配。
本题的任务是检验一个给定表达式中的括号是否正确匹配。
输入一个只包含圆括号和方括号的字符串,判断字符串中的括号是否匹配,匹配就输出“OK”,不匹配就输出“Wrong”。
Input Format
一行字符,只含有圆括号和方括号,个数小于255。
Output Format
匹配就输出一行文本“OK”,不匹配就输出一行文本“Wrong”。
[(])
Wrong
2024吉利学院ACM暑假实践周训练6
- Status
- Done
- Rule
- XCPC
- Problem
- 7
- Start at
- 2024-7-9 13:30
- End at
- 2024-7-9 16:30
- Duration
- 3 hour(s)
- Host
- Partic.
- 31