Class Book: book description
C#
Easy
classes
Task «Class Book: book description»
Create a class Book with fields Title (string), Author (string), and Year (integer). Implement the PrintInfo() method, which outputs information about the book in the format: "Title: {Title}, Author: {Author}, Year: {Year}". In main, read three lines: title, author, and year. Create a Book object, set the fields, and call the PrintInfo() method.
Input Format
Three lines: the first is the book title, the second is the author, the third is the year of publication (an integer).
Output Format
A string with information about the book in the specified format.
Examples
Example 1
INPUT
1984
Джордж Оруэлл
1949
OUTPUT
Title: 1984, Author: Джордж Оруэлл, Year: 1949
Example 2
INPUT
3
{"name":"Alice","age":"25"}
{"name":"Bob"}
{"age":"30","city":"NYC"}
{"name":"string","age":"string"}
OUTPUT
Title: 3, Author: {"name":"Alice","age":"25"}, Year: (не число)
Example 3
INPUT
0
10
OUTPUT
Title: 0, Author: 10, Year: (пусто)
main.cs