Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- #include <string>
- #include <algorithm>
- #include <stack>
- #include <queue>
- using namespace std;
- ifstream fin("input.txt");
- int main()
- {
- /*
- 1 2 2 3 3 3 4 4 4 4
- */
- queue<int> q;
- while (fin.peek() != EOF)
- {
- int cur;
- fin >> cur;
- q.push(cur);
- }
- int last = -1111111;
- while (!q.empty())
- {
- int cur = q.front();
- q.pop();
- if (cur != last || last == -1111111)
- cout << cur << ' ';
- last = cur;
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement