Write a program that checks for correct parentheses in a mathematical expression. Brackets of the same type are used: ( ). An expression can have multiple levels of nesting. Input The input is a character string representing an arithmetic expression. Imprint If the brackets are placed correctly, then display the word Yes, otherwise - No and the number of incorrectly placed brackets (a bracket is considered incorrectly placed if it does not have a pair) .
( )
Yes
No
1000 ms 32 Mb Rules for program design and list of errors in automatic problem checking