-->
当前位置:首页 > 题库

PROGRAMMING:Jack Cheng's troubles 2

Luz5年前 (2021-05-10)题库465
When jackcheng first entered junior high school, his grades were excellent, especially to the surprise of the teachers that the child could program. As we all know, with falling into the game, jackcheng's only programming knowledge not only has no progress, but also has greatly degenerated. On this day, his math teacher suddenly had a surprised idea. He wanted to promote the students to learn some programming knowledge, exercise their logical ability, and let the students learn math better. So he thought of jackcheng.
Jackcheng is really flustered. He has to ask you for help again.
Here is his email to you:
Okami:
I need God's help. Write a program for me.
Problem Description: bracket matching
Judge whether the input bracket string follows the use principle of mathematical brackets.
For example: (()) true; ())( false ;
The brackets here only include () and {}.
###Input format:
The first line gives n (n > 0 & & n < 100000), representing the number of parentheses entered. The next line is the input of parentheses..
###Output format:
If you follow the principle of using parentheses in mathematics, you can output true, otherwise you can output false.
###Input example:
```in
six
()}{()
```
###Output example:
```out
False
```






answer:If there is no answer, please comment