SHARE
TWEET

Untitled

a guest Jan 14th, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void sub(int n, int v[], int x)
  2. {
  3.     int cnt = 0;
  4.     for(int i = n -1 ; i >= cnt ; )
  5.         if(v[i] == x)
  6.         {
  7.             cnt ++;
  8.             for(int j = i ; j > 0 ; j --)
  9.                 v[j] = v[j-1];
  10.         }
  11.         else
  12.             i --;
  13.     for(int i = 0 ; i < cnt ; i ++ )
  14.         v[i] = x;
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top