A person contact

Currently used centrally called brominated flame-retardants (BFRS). Analysis methods, including chromatographic separation, sample preparation, & quality control testing methods are discussed. An important new analysis of the current development, TBBP - A is growth performance liquid chromatographic method. In mass spectrometry, testing phase is mature technologies - & reliable TBBP - A recognition & quantification. Although interlaboratory exercises for BFRS increasingly popular historically decade, only A few participate in laboratory document TBBP - A concentration. In the work of abiotic surroundings level TBBP - A & biological matrix is low, probably due to the main use TBBP - A as reaction. As a result, human exposure to low. This is the risk assessment, the conclusion is that the relevant TBBP - A human exposure

转载于:https://www.cnblogs.com/mar87/archive/2010/05/29/1747201.html

#include "ContactPerson.h" #include <iostream> #include"Person.h" #ifndef ContactPerson.cpp #include<string> #include<vector> #include<fstream> #include <algorithm> #include<sstream> using namespace std; void contact_Person::Menu() { //菜单 ; cout << "=======================================================================" << endl; cout << "=========================== 联系人管理系统 ============================" << endl; cout << "=======================================================================" << endl; cout << "|| 1. 添加人员 ||" << endl; cout << "|| 2. 按姓名电话查询 ||" << endl; cout << "|| 3. 按地址模糊查询 ||" << endl; cout << "|| 4. 按类别查询 ||" << endl; cout << "|| 5. 按姓名排序输出 ||" << endl; cout << "|| 6. 修改信息 ||" << endl; cout << "|| 7. 按姓名电话删除 ||" << endl; cout << "|| 8. 显示所有联系人 ||" << endl; cout << "|| 0. 退出系统 ||" << endl; cout << "=======================================================================" << endl; } void contact_Person::output() { //输入功能; string name1, sex, address, postal_code1, classification,qq; string telephone; string chiose, Letter_box2; ofstream mycout("D:\\Flie.txt",ios::app); if (!mycout) { cout << "打开文件失败" << endl; } else { do { cout << "请输入名字" << " "; cin >> name1; std::system("cls"); cout << "请输入性别" << " "; cin >> sex; std::system("cls"); cout << "请输入电话" << " "; cin >> telephone; std::system("cls"); cout << "请输入地址" << " "; cin >> address; std::system("cls"); cout << "请输入邮编" << " "; cin >> postal_code1; std::system("cls"); cout << "请输入邮箱" << " "; cin >> Letter_box2; std::system("cls"); cout << "请输入QQ号" << " "; cin >> qq; std::system("cls"); cout << "请输入类别" << " "; cin >> classification; std::system("cls"); mycout << "名字" << name1 << " " << "性别" << sex << " " << " 电话" << telephone << " " << "地址" << address << " " << "邮编" << postal_code1 << " " << " 邮箱" << Letter_box2 << " " << "QQ号" << qq << " " << "类别" << classification << endl; ifstream mycin("D:\\Flie.txt", ios::in); if (!mycin) { cout << "读取失败" << endl; } //将读取的文件存放到一个line变量 string line; while (getline(mycin, line)) { istringstream iss(line); iss >> name1 >> sex >> address >> classification >> Letter_box2 >> postal_code1 >> qq >> telephone; //这是把输入的变量先存放到一个新的contact_Person类的对象, // 然后把这个新的对象作为被读取的值传给一个contact_Person类型的contact容器中; contact_Person newcontact_Person(name1, sex, address, classification, Letter_box2, postal_code1, qq, telephone); contact.push_back(newcontact_Person); contact.size(); } cout << " 添加成功" << endl; cout << " 是否继续输入y(是)/n(否)" << endl; cin >> chiose; } while (chiose != "n"); mycout.close(); } } void contact_Person::Query_function1() { string chiose; //查询功能1(姓名·电话查询信息); do { cout << "请选择1名字查寻,2电话查询" << endl; int a; cin >> a; if (a == 1) { cout << " 请输入要查询的人名字" << endl; string NAME; cin >> NAME; //用find_if查找(find_if,为algorithm库中函数),遍历容器contact(容器contact在输入是已经输入过值) //此时只需找到name==NAME; auto it = find_if(contact.begin(), contact.end(), [&NAME]( contact_Person& obj) { return obj.Name == NAME; }/*这里是所要查询的元素,返回contact_Person类中和输入相同的name,作为find_if的需查询内容的参数*/); if (it != contact.end()) { // 找到 contact_Person& found = *it; // 解引用迭代器,得到对象 std::system("cls"); cout << "姓名" << found.Name << " " << "性别" << found.Sex << " " << "电话" << found.TelePhone << " " << "地址" << found.Address << " " << "邮编" << found.Postal_code << " " << " 邮箱" << found.Letter_box << " " << "QQ号" << found.QQ << " " << "类别" << found.Classification << endl; } else { cout << "未找到姓名为 [" << NAME << "] 的联系人" << endl; system("pause"); } system("cls"); cout << "是否继续查询y(是)/n(否)" << endl; cin >> chiose; } else if (a == 2) { // 电话查询 cout << "请输入要查询的人电话" << endl; string TELEPHONE; cin >> TELEPHONE; //用find_if查找(find_if, 为algorithm库中函数), // 遍历容器contact(容器contact在输入是已经输入过值) auto IT = find_if(contact.begin(), contact.end(), [&TELEPHONE]( contact_Person& obj2) { return obj2.TelePhone == TELEPHONE; }); if (IT != contact.end()) { contact_Person& found = *IT; std::system("cls"); cout << "姓名" << found.Name << " " << "性别" << found.Sex << " " << "电话" << found.TelePhone << " " << "地址" << found.Address << " " << "邮编" << found.Postal_code << " " << " 邮箱" << found.Letter_box << " " << "QQ号" << found.QQ << " " << "类别" << found.Classification << endl; } else { cout << "未找到电话为 [" << TELEPHONE << "] 的联系人" << endl; system("pause"); } system("cls"); cout << "是否继续查询y(是)/n(否)" << endl; cin >> chiose; } } while (chiose != "n" ); } //查询功能2(地址模糊查寻) ; void contact_Person::Query_function2() { string chiose; do { string ADDRESS; cout << " 请输入地址" << endl; cin >> ADDRESS; //用find_if查找(find_if, 为algorithm库中函数), // 遍历容器contact(容器contact在输入是已经输入过值) auto IT2 = find_if(contact.begin(), contact.end(), [&ADDRESS]( contact_Person obj3) { return obj3.Address == ADDRESS; }); if (IT2 != contact.end()) { contact_Person& found = *IT2; std::system("cls"); cout << "姓名" << found.Name << " " << "性别" << found.Sex << " " << "电话" << found.TelePhone << " " << "地址" << found.Address << " " << "邮编" << found.Postal_code << " " << " 邮箱" << found.Letter_box << " " << "QQ号" << found.QQ << " " << "类别" << found.Classification << endl; } else { cout << "未找到地址为 [" << ADDRESS << "] 的联系人" << endl; } cout << "是否继续查询y(是)/n(否)" << endl; cin >> chiose; } while (chiose != "n"); } //查询功能3(类别查询); void contact_Person::Query_function3() { string chiose; do { string CLASSIFICATION; cout << " 请输入类别" << endl; cin >> CLASSIFICATION; //find_if( auto TI3 = find_if(contact.begin(), contact.end(), [&CLASSIFICATION]( contact_Person& obj4){ return obj4.Classification == CLASSIFICATION; }); if (TI3 != contact.end()) { contact_Person& found4 = *TI3; std::system("cls"); cout << "姓名" << found4.Name << " " << "性别" << found4.Sex << " " << "电话" << found4.TelePhone << " " << "地址" << found4.Address << " " << "邮编" << found4.Postal_code << " " << " 邮箱" << found4.Letter_box << " " << "QQ号" << found4.QQ << " " << "类别" << found4.Classification << endl; } else { cout << "未找到类别为 [" << CLASSIFICATION << "] 的联系人" << endl; } cout << "是否继续查询y(是)/n(否)" << endl; cin >> chiose; } while (chiose != "n"); } //根据姓名排序输出(名字首字母顺序); void contact_Person::Name_sorting_output() { } void contact_Person::Alter() { //修改信息; cout << "请输入你要修改的内容" << endl; string name, sex, Address, QQ, Classification; string Postal_code, TlePhone; cout << "请选择修改的字段:" << endl; cout << "1: 姓名" << endl; cout << "2: 性别" << endl; cout << "3: 电话" << endl; cout << "4: 地址" << endl; cout << "5: 邮编" << endl; cout << "6: 邮箱" << endl; cout << "7: QQ" << endl; cout << "8: 类别" << endl; int choice; cin >> choice; switch (choice) { case 1: cout << "请输入修改后的姓名" << endl; cin >> name; break; case 2: cout << "请输入修改后的性别" << endl; break; case 3: default: break; } } //未完待续 void contact_Person::Name_TelePhone_Alter() {} //根据姓名·电话修改; void contact_Person::Name_TelePhone_Delete() {} //根据姓名·电话删除 ; void contact_Person::Dispiay() { cout << " " << endl; system("cls"); cout << "______________________________这是从文件中读取的————————————————" << endl; ifstream mycin("D:\\Flie.txt", ios::in); if (!mycin) { cout << "读取失败" << endl; } string line; while (getline(mycin, line)) { // 读取整行内容 cout << line << endl; } mycin.close(); cout << "____________________________________________________________________________" << endl; cout << "__________________________下面是读取的一个string容器contac2的内容———————————————" << endl; ifstream mycin1("D:\\Flie.txt", ios::in); if (!mycin1) { cout << "读取失败" << endl; } string line1; while (getline(mycin1, line1)) { contact2.push_back(line1); for ( auto& str : contact2) { cout << str << endl; contact2.clear(); } } mycin.close(); system("pause"); system("cls"); } #endif // !Contact_Person.cpp
06-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值