From af6e1c1f42007aa3d8742d18f3894252450e7adb Mon Sep 17 00:00:00 2001 From: pi5fnqcfr <824659727@qq.com> Date: Wed, 10 Jan 2024 09:44:19 +0800 Subject: [PATCH] ADD file via upload --- daoru.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 daoru.cpp diff --git a/daoru.cpp b/daoru.cpp new file mode 100644 index 0000000..7d952eb --- /dev/null +++ b/daoru.cpp @@ -0,0 +1,20 @@ +#include +#include +#include"library.h" +#include"book.h" +using std::cout; +using std::cin; +using std::endl; + +Book booklist[50]; +int num{}; +void wxy::daoru() +{ + std::ifstream ifile("booklist.txt"); + ifile >> num; + for (int i {}; i < num; i++) + { + ifile >> booklist[i].Name >> booklist[i].Auther >> booklist[i].amount; + } + ifile.close(); +} \ No newline at end of file