Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- const int n=10;
- int v[]={1,2,2,3,3,4,4,4,5,6};
- int j=0;
- for (int i=0;i<n-1;i++)
- if (v[i]!=v[i+1])
- {
- v[j]=v[i];
- j++;
- }
- v[j]=v[n-1];
- for (int i=0;i<=j;i++)
- cout<<v[i]<<' ';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement