Here is the translation of the programming task text from Russian to English: Class Book with a method for displaying information
C++
Easy
classes
Task «Here is the translation of the programming task text from Russian to English: Class Book with a method for displaying information»
Create a class `Book` with fields `title` (book title), `author` (author), and `year` (year of publication). Implement a method `display()` that outputs information about the book in the format: "Title: <title>, Author: <author>, Year: <year>". In `main()`, create an object of the `Book` class, read three lines from the console (title, author, year), and call the `display()` method.
Input Format
Three lines: the first line is the book title, the second line is the author, the third line is the year of publication (an integer).
Output Format
One line in the format: "Title: <title>, Author: <author>, Year: <year>"
Examples
Example 1
INPUT
Война и мир
Лев Толстой
1869
OUTPUT
Название: Война и мир, Автор: Лев Толстой, Год: 1869
Example 2
INPUT
1984
Джордж Оруэлл
1949
OUTPUT
Название: 1984, Автор: Джордж Оруэлл, Год: 1949
Example 3
INPUT
0
1
5
increment
increment
decrement
reset
increment
OUTPUT
Название: 0, Автор: 1, Год: 5
main.cpp