c手机通讯录管理系统内容摘要:

{ cout错误,重新输入。 \n。 break。 13 } cout\t姓名 \t学号 \t性别 \t家庭住 \t电话号码 endl。 cout\tsnames\tsid\tsex\tsaddrtsphonenoendl。 ofstream data(,ios_base::app)。 datasetw(10)snamessetw(10)sidsetw(10)sexsetw(10)saddrsetw(20)sphonenoendl。 } } void infor::src() { char ch。 ifstream da()。 cout\t姓名 \t学号 \t性别 \t家庭住 址\t电话号码 endl。 while ((ch)) cout ch。 ()。 } void infor::inall() { int m,n=1。 cinm。 if(m==1) { infor s33。 ifstream da(,ios_base::in)。 string sex。 while(()==0) { dasex。 n++。 } ()。 cout共有联系人 :nendl。 14 } else if(m==2) { infor s33。 ifstream da(,ios_base::in)。 int male=0,female=0。 string name,id,sex。 while(()==0) { danameidsex。 if (sex==男 ) { dasex。 male++。 } else if(sex==女 ) { dasex。 female++。 } } cout男生有 male人 \n。 cout女生有 female人 \n。 ()。 } else { coutError!!!\n。 } } void infor::select() { infor s44。 string name,id,sex。 int m。 cinm。 ifstream da(,ios_base::in)。 if(m==1) { cout输入要查询学号: \n。 15 cinid。 while(()==0) { dasex。 if(==id) { cout 姓名 setw(10)学号 setw(10)性别 setw(15)家庭住址 setw(15)电话号码 endl。 cout\t\t\tsex\t\ts44.sphonenoendl。 } else { coutError!!!\n。 break。 } } ()。 } else if(m==2) { cout输入要查询姓名: \n。 cinname。 while(()==0) { dasex。 if(==name) { cout 姓名 setw(10)学号 setw(10)性别 setw(15)家庭住址 setw(15)电话号码 endl。 cout\t\t\tsex\t\ts44.sphonenoendl。 } else { coutError!!!\n。 break。 } } ()。 16 } else { coutError!!!\n。 } } void infor::del() { ifstream inData(, ios_base::in)。 ofstream outData(,ios_base::app)。 if (!outData || !inData) { cout endl 对不起 !!!!找不到文件 !!!! endl。 return。 } string sign。 cout endl 你要删除联系人的姓名或学号 :。 cin sign。 bool flag = true。 string str。 while (inData snames sid) { getline(inData, str)。 if ((sign==snames) || (sign==sid)) { cout endl 你想删除的联系人 : endl endl。 cout setiosflags(ios::left) setw(17) snames sid str endl。 flag = false。 break。 } outData setiosflags(ios::left) setw(17) snames sid str endl。 } if (flag) { cout endl 对不起 !!!联系人中没你找的人 !!!! endl endl。 } else { while (getline(inData, str)) 17 { outData str endl。 } ()。 ()。 ifstream in(, ios::in)。 ofstream out(, ios::out)。 if (!out || !in) { coutendl对不起不能打开文件 !!!endlendl。 return。 } while (getline(in, str)) { outstrendl。 } ()。 ()。 cout endl 这个人的信息已经。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。