Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("bac.in");
- int main()
- {
- int ap = 0;
- int nr1, nr2;
- fin >> nr1;
- while(fin >> nr2)
- {
- if(nr1 == nr2)
- ap++;
- else
- {
- if(ap == 1)
- cout << nr1 << " ";
- ap = 0;
- }
- nr1 = nr2;
- }
- if(ap == 1)
- cout << nr1 << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement