Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- #include "list.cpp"
- ifstream fin("input.txt");
- ofstream fout("output.txt");
- int main()
- {
- List <int> list;
- int value;
- while (fin >> value)
- {
- list.Insert(list.GetLength() + 1, value);
- }
- fout << "Исходный список:";
- list.Print();
- int i = 1;
- while (i + 1 <= list.GetLength())
- {
- if (list.Get(i) == list.Get(i + 1)) list.Remove(i);
- else i++;
- }
- fout << "Измененный список:";
- list.Print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement