Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "TopList.h"
- List<Data> l;
- void menu()
- {
- cout << "Welcome, press: "<< endl << "1 - Print All" << endl << "2 - find by surname" << endl << "3 - find by id" << endl << "9 - exit" << endl;
- while (true)
- {
- string request;
- cout << "Enter you request: ";
- cin >> request;
- if (request.find('1') == 0)
- {
- l.PrintAll();
- }
- if (request.find('2') == 0)
- {
- string param;
- cout << "Enter surname: ";
- cin >> param;
- l.Find(param, true);
- }
- if (request.find('3') == 0)
- {
- string param;
- cout << "Enter id: ";
- cin >> param;
- l.Find(param, false);
- }
- if (request.find('9') == 0)
- {
- cout << "Thank from Porrowind!!!";
- Sleep(800);
- return;
- }
- cout << endl;
- }
- }
- void main()
- {
- Data data, data2;
- SetData(data, 1, 18, "Egorov", "Michail", "Russia", "Not working", "Football", "5715543");
- SetData(data2, 2, 19, "Nikitin", "Pavel", "Russia", "Not working", "DOTA", "...");
- l = List<Data>();
- l.AddNode(data);
- l.AddNode(data2);
- menu();
- //l.PrintAll();
- //l.Find("1", false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement