Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(){
- std::string inp;
- std::cin >> inp;
- int a = 0;
- for(const auto c: inp){
- if( c < 0 ){ std::cout << "NOT OK"; exit(0);}
- a += (c == '(' ? 1 : -1);
- }
- std::cout << (a == 0? "OK": "NOT OK");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement