Advertisement
PROFESSOR_AIH

cp

Feb 13th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int n;
  5.     int array[1000000000],c,m,count=0,num;
  6.     scanf("%d %d", &n,&m);
  7.     for ( c = 0 ; c < n ; c++ )
  8.         scanf("%d", &array[c]);
  9.     for(c=0; c<n; c++)
  10.     {
  11.         num=array[c];
  12.         if(m==num)
  13.         {
  14.             array[c] = array[c+1];
  15.             count++;
  16.         }
  17.     }
  18.     for(c=0; c<n-count; c++)
  19.         printf("%d ", array[c]);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement