daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void menu(){
  2.     Vector a;
  3.     do{
  4.         cout << "\n        MENU\n" << "   Choose action\n"  << "   1. Array input\n" << "   2. Array output\n";
  5.         cout << "   3. Insert of new elements\n";
  6.         cout << "   4. Deleting of elements\n" << "   5. Array check\n" << "   6. Exit\n";
  7.         printf("   Command = ");
  8.         cin >> k;
  9.         cout << endl;
  10.         switch(k)
  11.         {
  12.             case 1 : {
  13.                 a.input();
  14.                 break;
  15.             }
  16.             case 2 : {
  17.                 cout << "Array = ";
  18.                 a.output();
  19.                 break;
  20.             }
  21.             case 3 : {
  22.                 int pos, elem;
  23.                 cout << "pos = ";
  24.                 cin >> pos;
  25.                 cout << "elem = ";
  26.                 cin >> elem;
  27.                 if (a.insert(pos, elem))
  28.                     cout << "Element was succesfuly insert\n";
  29.                 else{
  30.                     cout << "Number out of range\n";
  31.                 }
  32.                 break;
  33.             }
  34.             case 4 : {
  35.                     if (!del(a, n))
  36.                         cout << "There are no two zero\n";
  37.                     else
  38.                         cout << "Elements was succesfuly delete\n";
  39.                     break;
  40.             }
  41.             case 5 : {
  42.                     if (check(a, n))
  43.                         cout << "There are 2 equal elements\n";
  44.                      else
  45.                         cout << "There are no 2 equal elements\n";
  46.                 break;
  47.             }
  48.             default: k = 0;
  49.         }
  50.     }while(k);
  51.   delete []a;
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top