1、在iphone和电脑连接以后,打开itunes来点击左上角的图标并选择将文件添加到资料库。
2、下一步会d出一个新的窗口,选择自己需要导入的文件来打开。
3、这个时候返回主界面,在图示的位置点击那个手机图标以进入控制界面。
4、这样一来在左侧选择图书和在右侧勾选同步图书并选定自己需要导入的图书以后,确定应用即可实现iphone利用应用程序添加图书了。
#include <cstring>
#include <vector>
#include <fstream>
#include <map>
#include <iostream>
#include <algorithm>
using namespace std
class Library{
map<string,string>book_num
vector<string>people_num
map<string,string>::iterator ib
vector<string>::iterator ip
public:
Library(){
ib=book_num.begin()
ip=people_num.begin()
}
void set_book_num(string,string)
void delete_book_num(string)
void find_book_num(string)
void change_booke_num(string,string)
void add_people_num(string)
void lend_num(string,string)
void return_num(string,string)
void file_book(vector<string>::iterator)
void file_people(vector<string>::iterator)
}
void Library::set_book_num(string A,string B){
book_num.insert(A,B)
}
void Library::add_people_num(string A){
people_num.push_back(A)
}
void Library::find_book_num(string A){
map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A)
if(result==book_num.end())
cout<<"图书馆中查无此书!"<<endl
else
cout<<"图书馆中此书信息如下:"<<endl
cout<<result->first<<":"<<result->second<<endl
}
void Library::delete_book_num(string A){
map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A)
if(result==book_num.end())
cout<<"图书馆中查无此书!"<<endl
else
book_num.erase(result)
cout<<"已成功删除该书在图书馆中的记录"<<endl
}
void Library::change_booke_num(string A,string B){
map<string,string>::iterator result =find(book_num.begin(), book_num.end(), A)
if(result==book_num.end())
cout<<"图书馆中查无此书!"<<endl
else
result->second=B
}
void Library::file_people(vector<string>::iterator ifp){
ofstream file_p
file_p.open("/Users/apple/Documents/Library_p.txt",ios::out)
if(!file_p.is_open())
{
cerr<<"open file_people fail"<<endl
exit(-1)
}
file_p<<*ifp<<endl
file_p.close()
}
void Library::file_book(vector<string>::iterator ibp){
ofstream file_b
file_b.open("/Users/apple/Documents/Library_b.txt",ios::out)
if(!file_b.is_open())
{
cerr<<"open file_people fail"<<endl
exit(-1)
}
file_b<<*ibp<<endl
file_b.close()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)