Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include "ArrayList.h"
- using namespace std;
- int main()
- {
- ArrayList List;
- string data;
- List.LInsert("abc");
- List.LInsert("abcde");
- List.LInsert("abcdefg");
- List.LInsert("abcdefghi");
- cout << "저장된 데이터 출력" << endl;
- if (List.LFirst(data)) {
- cout << data << " " << endl;
- while (List.LNext(data)) {
- cout << data << endl;
- }
- }
- cout << "\n데이터 중 길이가 5이상인 데이터 삭제\n" << endl;
- if (List.LFirst(data)) {
- if (data.length() >= 5)
- List.LRemove();
- while (List.LNext(data)) {
- if (data.length() >= 5)
- List.LRemove();
- }
- }
- cout << "남은 데이터 출력" << endl;
- if (List.LFirst(data)) {
- cout << data << " " << endl;
- while (List.LNext(data)) {
- cout << data << endl;
- }
- }
- cout << endl;
- }
Add Comment
Please, Sign In to add comment