ID προβλήματος: | pn_sterms |
---|---|
Τίτλος: | Θετικά Αρνητικά S-Terms |
Βαθμός Δυσκολίας: | 5 |
Ημερομηνία Εισαγωγής: | 2000-06-04 |
Σχόλια: |
An S-Term is defined recursively as follows: "S" (without the quotes) is an S-Term and if N and M and S-terms, then "(NM)" (without the quotes) is also an S-Term. The length of an S-Term is the number of "S" it contains.
Write a program that reads an integer N from the standard input. If N is between -10 and -1 including, then output the number of s-terms with length abs(N), in one line. If N is between 1 and 10 (including), then output all the sterms with length N
Είσοδος | Έξοδος |
---|---|
|
|
|
|