我试图创建一个程序,用户在其中键入书籍,然后将其存储到书架中。当用户键入“DONE”时,条目必须结束。
我想得到以下输出:
Welcome to your digital library!
Enter a book you would like to add:
Enter name: Harry Potter
Enter author: Me
Enter pages: 313
Enter a book you would like to add:
Enter name: Lord of the rings
Enter author: Tolkien
Enter pages: 412
Enter a book you would like to add:
Enter name: DONE
The following books are available in your bookshelf:
1. Harry Potter written by Me. Pages: 313
2. Lord of the rings written by Tolkien. …Run Code Online (Sandbox Code Playgroud) c++ ×1