diff --git a/daochu.cpp b/daochu.cpp new file mode 100644 index 0000000..736271d --- /dev/null +++ b/daochu.cpp @@ -0,0 +1,20 @@ +#include +#include +#include +#include"book.h" +#include"library.h" +using std::cout; +using std::cin; +using std::endl; +extern Book booklist[50]; +extern int num; +void wxy::daochu() +{ + std::ofstream ofile("booklist.txt"); + ofile << num << '\n'; + for (int i = 0; i < num; i++) + { + ofile << booklist[i].Name << ' ' << booklist[i].Auther << ' ' << booklist[i].amount << '\n'; + } + ofile.close(); +} \ No newline at end of file