init
This commit is contained in:
31
exam-basedir06/subjects/brackets/subject.en.txt
Normal file
31
exam-basedir06/subjects/brackets/subject.en.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
Assignment name : brackets
|
||||
Expected files : *.c *.h
|
||||
Allowed functions: write
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write a program that takes an undefined number of strings in arguments. For each
|
||||
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.
|
||||
|
||||
An opening bracket must always be closed by the good closing bracket in the
|
||||
correct order. A string which not contains any bracket is considered as a
|
||||
correctly bracketed string.
|
||||
|
||||
If there is no arguments, the program must print only a newline.
|
||||
|
||||
Examples :
|
||||
|
||||
$> ./brackets '(johndoe)' | cat -e
|
||||
OK$
|
||||
$> ./brackets '([)]' | cat -e
|
||||
Error$
|
||||
$> ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
|
||||
OK$
|
||||
OK$
|
||||
$> ./brackets | cat -e
|
||||
$
|
||||
$>
|
||||
Reference in New Issue
Block a user