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