Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sub(int n, int v[], int x)
- {
- int cnt = 0;
- for(int i = n -1 ; i >= cnt ; )
- if(v[i] == x)
- {
- cnt ++;
- for(int j = i ; j > 0 ; j --)
- v[j] = v[j-1];
- }
- else
- i --;
- for(int i = 0 ; i < cnt ; i ++ )
- v[i] = x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement