Guest User

Untitled

a guest
Jun 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include "ArrayList.h"
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. ArrayList List;
  10. string data;
  11.  
  12. List.LInsert("abc");
  13. List.LInsert("abcde");
  14. List.LInsert("abcdefg");
  15. List.LInsert("abcdefghi");
  16.  
  17. cout << "저장된 데이터 출력" << endl;
  18. if (List.LFirst(data)) {
  19. cout << data << " " << endl;
  20. while (List.LNext(data)) {
  21. cout << data << endl;
  22. }
  23. }
  24.  
  25. cout << "\n데이터 중 길이가 5이상인 데이터 삭제\n" << endl;
  26. if (List.LFirst(data)) {
  27. if (data.length() >= 5)
  28. List.LRemove();
  29. while (List.LNext(data)) {
  30. if (data.length() >= 5)
  31. List.LRemove();
  32. }
  33. }
  34.  
  35. cout << "남은 데이터 출력" << endl;
  36. if (List.LFirst(data)) {
  37. cout << data << " " << endl;
  38. while (List.LNext(data)) {
  39. cout << data << endl;
  40. }
  41. }
  42. cout << endl;
  43. }
Add Comment
Please, Sign In to add comment