MUstar

IoT C++ 09/14 - MyArray_main.cpp

Sep 14th, 2017
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×