АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

160. Checking of Brackets

Time Limit: 1 seconds
Memory Limit:64000KB
Points:2
View Problem Statistics Submit Problem added Administrator

С клавиатуры вводится математическое выражение, содержащее скобки "(" и ")", в строку. Произвести проверку на корректность расстановки скобок. Если ввод корректен, то вывести "OK" (англ. алфавит), если некорректен, то вывести "ERROR". Исходная строка может ничего не содержать, при этом считать ее ввод корректным.

Input

Строка текста (до 255 символов).

Output

"OK" или "ERROR".

Sample

Input(afsasf(fsdfsdf)afasf(asfasfasf)asfsasa)()
OutputOK

Автор:Бутусов А.С.

View Problem Statistics Submit Author/source:
Educational Courses / Programming and Basics of Algorithmization / Strings /
125. Characters Sorting 160. 161. Make One Word from Another One 126. Removing of Nth word 162. Removing of k'st Symbol
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.405 sec.
© Copyright VSTU, AVT, Nosov D.A.