#include <bits/stdc++.h>
#include <fstream>
#include<map>
using namespace std;
struct book{
string name;
float money;
string cbs;
string fl;
};
int main(int argc, char** argv) {
map<string,book> a;
book b;
string data;
ofstream outfile;
ifstream infile;
infile.open("书.txt");
while(getline(infile,data)){
cout<<data<<endl;
}
infile.close();
outfile.open("书.txt",ios::app);
cin>>b.name>>b.money>>b.cbs>>b.fl;
outfile<<b.name<<"|"<<b.money<<"|"<<b.cbs<<"|"<<b.fl<<endl;
outfile.close();
a.insert(pair<string,book>(""),b);
infile.open("书.txt");
while(getline(infile,data)){
cout<<data<<endl;
}
infile.close();
// infile>>data;
// int m=0;
// data.substr(m,data.find("|"))=b.name;
// m=data.find("|");
// data.substr(m+1,data.find("|"))=b.money;
// m=data.find("|");
// data.substr(m+1,data.find("|"))=b.cbs;
// cout<<data<<endl;
// cout<<b.name<<" "<<b.money<<" "<<b.cbs;
// m=0;
return 0;
}