|
|
|
@ -7,6 +7,7 @@ argument, the program prints on the standard output "OK" followed by a newline
|
|
|
|
|
if the expression is correctly bracketed, otherwise it prints "Error" followed by |
|
|
|
|
a newline. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Symbols considered as `brackets` are brackets `(` and `)`, square brackets `[` |
|
|
|
|
and `]`and braces `{` and `}`. Every other symbols are simply ignored. |
|
|
|
|
|
|
|
|
@ -16,18 +17,20 @@ correctly bracketed string.
|
|
|
|
|
|
|
|
|
|
If there is no arguments, the program must print only a newline. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples of outputs : |
|
|
|
|
|
|
|
|
|
```console |
|
|
|
|
student@ubuntu:~/student/test$ go build |
|
|
|
|
student@ubuntu:~/student/test$ ./test '(johndoe)' | cat -e |
|
|
|
|
student@ubuntu:~/student/brackets$ go build |
|
|
|
|
student@ubuntu:~/student/brackets$ ./brackets '(johndoe)' | cat -e |
|
|
|
|
OK$ |
|
|
|
|
student@ubuntu:~/student/test$ ./test '([)]' | cat -e |
|
|
|
|
student@ubuntu:~/student/brackets$ ./brackets '([)]' | cat -e |
|
|
|
|
Error$ |
|
|
|
|
student@ubuntu:~/student/test$ ./test '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e |
|
|
|
|
student@ubuntu:~/student/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e |
|
|
|
|
OK$ |
|
|
|
|
OK$ |
|
|
|
|
student@ubuntu:~/student/test$ ./test | cat -e |
|
|
|
|
student@ubuntu:~/student/brackets$ ./brackets | cat -e |
|
|
|
|
$ |
|
|
|
|
student@ubuntu:~/student/test$ |
|
|
|
|
student@ubuntu:~/student/brackets$ |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|