#C11792. Book Section Classification
Book Section Classification
Book Section Classification
You are given the content of a book as an input string. Your task is to classify the book into one of three sections based on its content:
- Fiction: output
1
- Non-Fiction: output
2
- Reference: output
3
The classification is determined by detecting key phrases in the text. For example, a book with the content Magic of Numbers should be classified as Fiction, one with The Python Guide as Non-Fiction, and one with Python Reference as Reference.
Note: If the input does not match any of the above cases exactly, you may output a default value (for instance, 1).
inputFormat
The input is provided via standard input (stdin) and consists of a single line containing the book content.
outputFormat
Print a single integer to standard output (stdout) representing the book's section: 1
for Fiction, 2
for Non-Fiction, and 3
for Reference.
Magic of Numbers
1