Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void menu(){
- Vector a;
- do{
- cout << "\n MENU\n" << " Choose action\n" << " 1. Array input\n" << " 2. Array output\n";
- cout << " 3. Insert of new elements\n";
- cout << " 4. Deleting of elements\n" << " 5. Array check\n" << " 6. Exit\n";
- printf(" Command = ");
- cin >> k;
- cout << endl;
- switch(k)
- {
- case 1 : {
- a.input();
- break;
- }
- case 2 : {
- cout << "Array = ";
- a.output();
- break;
- }
- case 3 : {
- int pos, elem;
- cout << "pos = ";
- cin >> pos;
- cout << "elem = ";
- cin >> elem;
- if (a.insert(pos, elem))
- cout << "Element was succesfuly insert\n";
- else{
- cout << "Number out of range\n";
- }
- break;
- }
- case 4 : {
- if (!del(a, n))
- cout << "There are no two zero\n";
- else
- cout << "Elements was succesfuly delete\n";
- break;
- }
- case 5 : {
- if (check(a, n))
- cout << "There are 2 equal elements\n";
- else
- cout << "There are no 2 equal elements\n";
- break;
- }
- default: k = 0;
- }
- }while(k);
- delete []a;
- }
Add Comment
Please, Sign In to add comment