Advertisement
MUstar

IoT C++ 09/14 - MyArray_main.cpp

Sep 14th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include<iostream>
  2. #include"MyArray.h"
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7.     MyArray sys;
  8.     int select, input;
  9.     while(1)
  10.     {
  11.         cout<<"========동적배열테스트!========"<<endl;
  12.         cout<<"||1)입력|2)삭제|3)출력|4)종료||"<<endl;
  13.         cout<<"Select>"; cin>>select;
  14.         if(select==4)
  15.         {
  16.             sys.delete_(1);
  17.             break;
  18.         }
  19.         else
  20.         {
  21.             switch(select)
  22.             {
  23.                 case 1:
  24.                     cout<<"NumInput>"; cin>>input;
  25.                     sys.append(input);
  26.                     cout<<"값이 입력되었습니다."<<endl;
  27.                     break;
  28.                 case 2:
  29.                     if(sys.delete_(0))
  30.                         cout<<"마지막값이 삭제되었습니다."<<endl;
  31.                     else
  32.                         cout<<"배열에 값이 비였습니다."<<endl;
  33.                     break;
  34.                 case 3:
  35.                     sys.print();
  36.                     break;
  37.                 default:
  38.                     cout<<"잘못된 선택값입니다."<<endl;
  39.                     break;
  40.             }
  41.         cout<<endl;
  42.         }
  43.     }
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement