Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Известна следующая информация об n заявках в сервисном центре по ремонту
- компьютерной техники(n – натуральное число) : наименование товара, дата
- поступления, описание неисправности, статус заявки(напр, «рассматривается»
- или «обработано»).Удалить все записи со статусом заявки «обработано».*/
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- struct Information
- {
- string Name;
- string Date;
- string Problem;
- string Status;
- };
- int main()
- {
- int n;
- cout << "Enter n: " << endl;
- cin >> n;
- vector<Information> info(n);
- cin.ignore(100, '\n');
- cin.clear();
- for (int i = 0; i < n; i++)
- {
- cout << "Fill list " << i+1 << ":" << endl << "Name: " << endl;
- getline(cin, info.at(i).Name);
- cout << "Date: " << endl;
- getline(cin, info.at(i).Date);
- cout << "Problem: " << endl;
- getline(cin, info.at(i).Problem);
- cout << "Status: " << endl;
- getline(cin, info.at(i).Status);
- }
- for (int i = 0; i < info.size(); i++)
- {
- if (info.at(i).Status == "processed")
- {
- info.erase(info.begin() + i);
- }
- }
- cout << "*******************************************************************" << endl;
- cout << "Results: " << endl;
- for (int i = 0; i < info.size(); i++)
- {
- cout << "List " << i + 1 << ":" << endl << info.at(i).Name << endl << info.at(i).Date << endl << info.at(i).Problem << endl << info.at(i).Status << endl;
- cout << " ***" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement