Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- std::vector<int> v;
- int n, i=-1, cnt=0;
- while (cin>>n) {
- v.push_back(n);
- i++;
- if (i>0) {
- if (v[i]==v[i-1]) {
- cnt++;
- if (cnt==2)
- cout << v[i] << '\n';
- }
- else cnt=0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement