semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//********************************
//*?????? 1300012809      **
//*???2013.10.30             **
//*???????????       **
//********************************
int main ()
{  
	int n,k,i,j,l,m,jishu;
	cin >> n;
	int a[1000001]={0};                     //????
	for (i=0;i<n;i++)
	{
		cin >> a[i];                        //???????????
	}
	cin >> k;
	jishu=0;
    for (j=0;j<n;j++)
	{
		do
		{
		if (a[j]==k)                        //?????????
		{
			jishu=jishu+1;                  //??????????????????
			a[j]=a[j+1];
			for (l=j+1;l<n;l++)
			{
				a[l]=a[l+1];                //??????
			}
		}
		}while (a[j]==k);                   //????????????????

	} 
	for (i=0;i<(n-jishu);i++)
	{
		if (i==0) cout << a[0];             //?????????????
		if (i!=0) cout << " " << a[i] ;
	}

    return 0 ;
}
int main()
{
	int n=0,i=0,k=0,j=0,f=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>k;
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			f=f+1;
			for(j=i;j<n-1;j++)
				a[j]=a[j+1];
			i=i-1;
			a[n-1]=0;
		}
	}
	for(i=0;i<n-f;i++)
	{
		if(i<n-f-1)cout<<a[i]<<' ';
		if(i==n-f-1)cout<<a[i]<<endl;
	}
	return 0;
}
/**
* @file 1000012853_3
* @author 1000012853 ??
* @date 2010.10.30
* @desc ???????
*/
int main()
{
	int k, n, num, a[100000];                             //????
	cin >> n;
	for ( int i = 0; i < n; i ++)                        //????
	{
		cin >> a[i];
	}
	cin >> k;                                            //???????
	int count = 0;
	for ( int s = 0; s < n; s ++)                    
	{
		if ( a[s] == k)                                  //????????????
		{   count ++;
			for (int j = s; j < n; j ++)
			{
				a[j] = a[j+1];
			}
			s --;                                        //?????????
		}
	}
	num = n - count; 
	cout << a[0];                                        //??????????????
	for ( int l = 1; l < num; l ++)                      //????
	{
		cout <<' '<< a[l];
	}
	return 0;
}                                                        //?????
int main()
{
	int i, n, k, a[100002], g = 0, t;
	cin >> n;
	for(i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for(i = 0; i < n; i++)
	{
		while(a[i] == k)
		{
			for(t = i; t <= n; t++)
			{
				a[t] = a[t + 1];
			}
			g++;
		}
	}
	for(i = 0; i < (n - g); i++)
	{
		if(i != (n - g - 1))
		{cout << a[i] << " ";}
		else
		{cout << a[i];}
	}
	return 0;
}
void main()
{
      int a[1000000];
      int i,n,del,j;
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
       scanf("%d",&a[i]);
       }
       scanf("%d",&del);
       for(i=1;i<=n;i++)
      {
                           if(a[i]==del) 
                           {
                             for(j=i;j<=n;j++)   
                             a[j]=a[j+1];
                             i--;
                             n--;}
       }
      for(i=1;i<n;i++)
      printf("%d ",a[i]);
      printf("%d",a[n]);
}
int main() {
	int n;
	int a[100001];
	int i, j, k;
	int g;
	scanf("%d", &n);
	
	for(i=0; i<n; i++) {
		scanf("%d", &a[i]);
	}
	scanf("%d", &k);
	
	g = 0;
	for(i=0; i<n; i++) {
		if(a[i] == k) continue;
		
			if(g == 1) {
				printf(" %d", a[i]);
			} else {
				printf("%d", a[i]);
				g = 1;
			}
		
	}
	return 0;
}
/*
 * ????1000012702_25.cpp
 * Created on: 2010-10-29
 * Author: ???
 * ???????????
 */
int main(){
	int n,k;  //?????? n:?????????k:????????
	int a[100001];  //??????a???100001???
	cin>>n;  //????a?????
	int i,j,s=0;  //????i,j,?????t
	for(i=1;i<=n;i++)cin>>a[i];  //??????????n???
	cin>>k;  //???????k
	for(i=1;i<=n;i++){  //??,????1???n
			if(a[i]==k){   //???????????????,??????
				s++;    //???????
				for(j=i;j<n;j++)a[j]=a[j+1]; //???????????????,?????
				a[j]=0;  //????????0,???????????
				i--;  //i??,?????????
				}
			}
		for(i=1;i<n-s;i++)
			cout<<a[i]<<" ";
		cout<<a[i];//?????????????
		return 0;
	}
int main()
{
	int a[100000];
	int *p;
	p=a;
	int i,m,k,n,l=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			for(m=i;m<n;m++)
				*(p+m)=*(p+m+1);
			l=l+1;
			i=i-1;
		}
	}
	for(i=0;i<n-l;i++)
		if(i<n-(l+1))printf("%d ",a[i]);
	else printf("%d",a[i]);
	return 0;
}
void main()
{ int n,i,k,j;
  int t[100000];
  scanf("%d\n",&n);
  for (i=0;i<=(n-1);i++)
     scanf("%d",&t[i]);
  printf("\n");
  scanf("%d",&k);
  for (i=0;i<=(n-1);i++)
     if (t[i]==k) t[i]='a';
  if (n==1) {if (t[0]!='a') printf("%d",t[0]);}
  else
  {for (i=0;i<=(n-1);i++)
     { if (t[i]!='a')
       {printf("%d",t[i]);
        for (j=(i+1);j<=(n-1);j++)
        if (t[j]!='a') printf(" %d",t[j]);
        break;
        }
      }
   }
}
int main()                                  
{
	int i,j,k;
	int n,del,counter=0,p=0;
	int *a;
    scanf("%d",&n);
	a=(int *)malloc(n*sizeof(int));	;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>del;

	for(j=0;j<n;j++)
	{
		if(a[j]==del)
		{
			 counter=counter+1;
             for(k=j+1;k<n;k++)
				 if(a[k]!=del)
				 {
					 a[j]=a[k];
                     for(i=k;i<n;i++)
					 {
						 a[i]=a[i+1];
					 }
					  
					 goto end;
				 }
 
		}
		end:;
	}

	for(i=0;i<n-counter;i++)
	{
		if(p!=0)
		cout<<" ";
		cout<<a[i];
		p=1;
	}
    
                  
    return 0;
}
int main()
{
	int n, k, l = 0, count = 0;
	cin >> n;
	int num[100001] = {0};
	int Num[100001] = {0};

	for(int i = 0; i < n; i++)
	{
		cin >> num[i];
	}
	cin >> k;

	for(int j = 0; j < n; j++)
	{
		if(num[j] != k)
		{
			Num[l] = num[j];
			l++;
		}
		else
			count++;
	}

	for(int p = 0; p < n - count; p++)
	{
		if(p == 0)
			cout << Num[p];
		else
			cout << " " << Num[p];
	}
	return 0;
}
/*
 * 1.cpp
 *???????????????????????????????????
?????????????????????????????

??????????? int a[20]={1,3,3,0,-3,5,6,8,3,10,22,-1,3,5,11,20,100,3,9,3};
??????3?????????????20???9?????????
????????????????????????????*?????????????
1, 0, -3, 5, 6, 8, 10, 22, -1, 5, 11, 20, 100, 9, *, *, *, *, *, *
???????????????
1 0 -3 5 6 8 10 22 -1 5 11 20 100 9

???????????????????????????????????
    ???????????????????????????
 *
 *  Created on: 2013-10-25
 *      Author: 13190
 */
int main()
{
	int n=0,k=0,i=0,j=0;
	cin>>n;

	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	    cin>>k;
	for(i=0;i<n;i++)
	{
		if(a[i]!=k)
			{
			a[j]=a[i];//???????????
		    j++;
			}
	}
	for(int s=0;s<j;s++)//???????
	{
		if(s<j-1)
		cout<<a[s]<<" ";//??????????
		if(s==j-1)
			cout<<a[s];

	}
	return 0;
}
int main()
{
    int n, i, k, m, p, q, a[100000];
	cin >> n;
	p = 1;
	for(i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	for(i = n - 1; i >= 0; i--)
	{
		if(a[i] == k)
		{
			for(m = i; m <= n - p; m++)
                a[m] = a[m + 1];
			p++;
			i++;
		}
	}
	for(q = 0; q <= n - p; q++)
	{	
		cout << a[q];
	    if(q != n - p)
			cout << " ";
	}
	return 0;
}
main()
{
      int a,b,i;
      int c[100000];
      scanf("%d",&a);
      for(i=0;i<a;i++)
      {
                      scanf("%d",&c[i]);
      } 
      scanf("%d",&b);
      int k=0;
      for(i=0;i<a;i++)
      if(c[i]!=b)
      {
                 if(k==0)
                 {printf("%d",c[i]);k=1;}
                 else
                 printf(" %d",c[i]);
      }
      getchar();
      getchar(); 
}
int main()
{
 int n,m,i,t,j;
 int a[100000]={0};
 cin>>n;
 for(i=0;i<n;i++)
  cin>>a[i];
 cin>>m;
 i=0;
 t=0;
 while(i<n-t)
  {if(a[i]==m)
    {t=t+1;
     for(j=i;j<n-t;j++)
      a[j]=a[j+1];
     }
  else i++;}
for(i=0;i<n-t-1;i++)
 cout<<a[i]<<" ";
 cout<<a[n-t-1]<<endl;
return 0;}
int main()
{
   int n,k;
   cin>>n;
   int a[100000];
   for(int i=0;i<n;i++)//???????
	   cin>>a[i];
   cin>>k;
   int t=0;
   for(int i=0;i<n-t;)
   {
      if(a[i]==k)
	  {
	      for(int j=i;j<n-t;j++)
			  a[j]=a[j+1];
		  t++;
	  }
	  else
		  i++;
   }
   for(int i=0;i<n-t-1;i++)
	   cout<<a[i]<<" ";
   cout<<a[n-t-1];
   return 0;
}
int main(){
	int n,i,k,t,m;
    int sz[100000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
	scanf("%d",&sz[i]);
	}
	scanf("%d",&k);
	t=0;
    for(i=0;i<n;i++){
		if(sz[i]==k){
		t=t+1;}
	}
		for(m=0;m<100;m++){
			for(i=0;i<n;i++){
				if(sz[i]==k){
					sz[i]=sz[i+1];
					sz[i+1]=k;
				}
			}
		}
		for(i=0;i<n-t;i++){
			if(i==0){printf("%d",sz[i]);}
			else{printf(" %d",sz[i]);}}
			return 0;
		}
int main(){
	int t;   //?????t
	cin>>t;    //??t??
	const int n=t;  //??????n(????????),???t
	int a[n];   //?????a,??n???
	int i,j,k=0;  //??????i,j;??????????????k
	for(i=0;i<n;i++)  //??n???,?????a?
		cin>>a[i];
	int num;   //???????
	cin>>num;   //????????
	for(i=0;i<n;i++){  //??,????0???n-1
		if(a[i]==num){   //???????????????,??????
			k++;    //???????
			for(j=i;j<n-1;j++)
				a[j]=a[j+1]; //???????????????,?????
			a[j]=0;   //????????0,???????????
			i--;  //i??,?????????
			}
		}
	for(i=0;i<n-k-1;i++)
		cout<<a[i]<<" ";
	cout<<a[i];//?????????????
	return 0;
}
void main()
{
	long n, a[100000], k, i;
	scanf("%ld", &n);
	for(i=0; i<n; i++)
		scanf("%ld", &a[i]);
	scanf("%ld", &k);
	for(i=0; i<n; )
	{
		if(a[i]!=k) break;
		i++;
	}
	printf("%ld", a[i]);
	for(i=i+1; i<n; i++)
	{
		if(a[i]==k) continue;
		printf(" %ld", a[i]);
	}
	printf("\n");
}
//****************************************
//*??: ????????               **
//*?????? 1100013012              **
//*???2011.10.21                     **
//****************************************
int main()
{
	int k , n;                                             // ????k???????  n??????? 
	int a[100000];                                         // ????a
	int i , j;                                             // ??????i j
	cin >> n;                                              // ??n
	for ( i = 0; i < n; i++ )                              // ????????????
	{
		cin >> a[i];
	}
	cin >> k;                                              // ??k
	for ( i = 0; i < n; i++ )                              // ????????????????
	{
		if ( a[i] == k )                                   // ????
		{
			for ( j = i ; j < n; j++ )                     // ????k???????????
			{
				a[j] = a[j+1];                             // ???????????
			}
		n--; i--;                                          // ????????i-1??????????????
		}
	}
	for ( i = 0; i < n; i++ )                              // ????????
	{
		cout << a[i];                                      
		if ( i != n-1 ) cout << " ";                       // ???????
	}
	return 0;
}
int n, a[100001], k;
int main()
{
    int i, j;
    cin >> n;
    for (j = 1; j <= n; ++ j)
        cin >> a[j];
    cin >> k;
    i = 0;
    for (j = 1; j <= n; ++ j)//?i?????????k????????a[j]???i?????k??a[j]?????i?
        if (a[j] == k)
            ++ i;
        else
            a[j - i] = a[j];
    for (j = n - i, i = 1; i < j; ++ i)//??
        cout << a[i] << " ";
    cout << a[i] << endl;
    return 0;
}
int s[1000000];
int main()
{
    int i,j,k,n,a,pos;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>s[i];
    cin>>k;
    for (int i=1;i<=n;i++)
        {if (s[i]!=k)
           pos=i;}
    for(i=1;i<=n;i++)
    {
        if(s[i]!=k && i!=pos)
            cout<<s[i]<<" ";
        if (s[i]!=k && i==pos)
           cout<<s[i]<<endl;
    }
    return 0;
}
//***************************
//*???????????  **
//*?????? 1300013007 **
//*???2013.10.30        **
//***************************
int main()
{
	int n;                     //n??????????
	long number, k;             //number????????,k?????????
	cin >> n;
	int a[100000]={0};
	int i, m, p, q, x=0;
	for(i=0; i<n; i++)         //??n???????????????
	{
		cin >> number;
		a[i] = number;
	}
	cin >> k;                  //k??????
	for(m=0; m<n; m++)
	{
		if(a[m] == k)
		{
			for(p=m+1; p<n; p++)   //??k????????
				a[p-1]=a[p];
			m--;                   //????m??????
			n--;
		}
	}
	for(q=0; q<n; q++)
	{
		cout << a[q];
		if(q==n-1)
			cout << endl;
		else
			cout << ' ';
	}
	return 0;
}
int main()
{
	int a[100000];
	int num,del,i,j;
	scanf("%d",&num);
	for(i=0;i<num;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&del);
	for(i=0;i<num;i++)
	{
		if(a[i]==del)
		{
			for(j=i;j<num;j++)
			{
				a[j]=a[j+1];
			}
			num--;
			i--;
		}
	}
	printf("%d",a[0]);
	for(i=1;i<num;i++)
	{
		printf(" %d",a[i]);
	}
	return 0;
}
/*
 * delete1.cpp
 *
 *  Created on: 2011-10-21
 *      Author: Administrator
 */


int main()//???
{
	int n,i,q,s;//??????
	cin>>n;
	int a[100001];//????
	for(i=0;i<n;i++)
	{
		cin>>a[i];//????
	}
	int k,j;
	cin>>k;
	for(q=0;q<n;q++)//????
	{
		if(a[q]!=k){s=q;}
	}
	for(j=0;j<=s-1;j++)
	{
		if(a[j]!=k)//????
		{
			cout<<a[j]<<" ";

		}
	}
	cout<<a[s];//??
	return 0;
}
//***********************************************
//???:????????                       *
//??????                                  *
//??10?29?                                  *
//***********************************************
int main()
{
    int a[100000] = {0}, n, s, i, j;
    cin >> n; 
    for(i = 0; i < n; i++)
    {
         cin >> a[i];
    }
    cin >> s;
    a[n] = s;
    for(i = 0; i < n; i++)
    {
         if(a[i] == s)
         for(j = i + 1; j < n; j++)
         {
             if(a[j] != s)
             {
                 a[i] = a[j];
                 a[j] = s;
                 break;
             }
         }
    }
    for(i = 0; i < n; i++)
    {
        if(a[i] == s)
        break;
        cout << a[i];
        if(a[i + 1]!= s)
        cout << " "; 
    }
    return 0;
    
}
int main(){
	int a[100000];int i,j,n=0,k=0,num=0;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>num;
	for(i=0;i<n;i++)

		{
              if(a[i]==num)

              { for(j=i;j<n-1;j++)
				 {a[j]=a[j+1];}
			     a[n-k-1]=0;
                  k=k+1;
			      i=i-1;}}

	for(i=0;i<n-k-1;i++)
		{cout<<a[i]<<" ";}
	cout<<a[n-k-1];
	return 0;
}
int a[100001];
int main()
{int n,samenum=0,t,d;
cin>>n;
for(int i=0;i<n;i++)
	cin>>a[i];
cin>>d;
for(int i=0;i<n;i++)
	{if(a[i]==d)
	  {samenum++;t=i;
	  do {a[t]=a[t+1];
          t++;}while(t<n);i--;
       }}
for(int j=0;j<n-samenum;j++)
{if(j<n-samenum-1) cout<<a[j]<<' ';
else cout<<a[j];
}
return 0;

}
int main()
{
	int a[100000], n, k;
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	for(int i = 0; i < n; )
		if(a[i] == k)
		{
			for(int j = i; j < n - 1; j++)
				a[j] = a[j + 1];
			n--;
		}
		else
			i++;
	cout << a[0];
	for(int i = 1; i < n; i++)
		cout << " " << a[i];
	cout << endl;
	return 0;
}
void main()
{
  int n,i,j,k,m,sum=0,a[100000];
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&a[i]);
  scanf("%d",&j);
  m=a[n-1];
  a[n-1]+=(a[n-1]==j);
  for(i=0;i<n-sum;i++)
  {
   k=i;
   if(a[i]==j)
   {
    for(;i<n-sum-1;i++) a[i]=a[i+1];
    sum+=1;
    i=k-1;
   }
  }
  if(m==j)
  {
   for(i=0;i<n-sum-2;i++)printf("%d ",a[i]);
   printf("%d\n",a[n-sum-2]);
  }
  else
  {
   for(i=0;i<n-sum-1;i++)printf("%d ",a[i]);
   printf("%d\n",a[n-sum-1]);
  }
}
int main(){
int flag=0;
int n;
cin>>n;
int w[100001];
for(int i=0;i<n;i++)
cin>>w[i];
int k;
cin>>k;
for(int i=0;i<n;i++)if(w[i]!=k){
if(flag)cout<<' ';else flag=1;
cout<<w[i];
}
cout<<endl;
return 0;
}
//??-????????
//2010?11?01?
//1000012753 ???


int main()
{
	int n, a[100002] = {0}, i, m = 0, j, k;

	cin >> n;

	for (i = 1; i <= n; i++)
	{
		cin >> a[i];
	}

	cin >> k;

	for (i = 1; i <= n - m; i++)
	{
		if (k == a[i])
		{
			m++;

			for (j = i; j <= n - m; j++)
			{
				a[j] = a[j+1];
			}
			
			i--;
		}
	}

	cout << a[1];

	for (i = 2; i <= n - m; i++)
		cout << " " << a[i];

	cout << endl;

	return 0;
}
void main()
{
	int i,j,n,k,b;
	int a[100010];
	scanf("%d",&n);
	for (i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	for (i=0;i<n-1;i++)
	{
		if (a[i]==k)
		{
			for (j=i;j<n;j++)
				a[j]=a[j+1];
			i--;
			n--;
		}
	}
	if (a[n-1]==k)
	{
		for(i=0;i<n;i++)
		{
			if(a[i]==k)
				n=i;
		}
	}
	for(i=0;i<n-1;i++)
		printf("%d ",a[i]);
	printf("%d",a[n-1]);
}
int main()
{
 int n=0,b=0,m=0;
 cin>>n;
 int a[n];
 for (int p=0;p<n;++p)
 {
	 cin>>a[p];
}
 cin>>b;
 for (int ii=0;ii<n;++ii)
 {
 if(a[ii]==b)
 {
	 m++;
 }
 }
 for (int i=0;i<n;++i)
 {
	 if(a[i]==b)
	 {
		 for(int b=i;b<n;b++)
		 {
			 a[b]=a[b+1];
		 }
		 i--;
	 }
}
 for(int o=0;o<n-m-1;o++)
   cout<<a[o]<<" ";
 cout<<a[n-m-1];
 return 0;
 }
//* ????????*
//* author:??? *
//* time : 10.19  *
 


int main()
{
	int a[100000] = {0};
	int n, k, i, j, m, h, g, t, num = 0, count = 0;
	cin >> n;
    for(i = 0; i <= n - 1; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for(j = 0; j <= n - 1; j++)
	{
		if(a[j] == k)
		{
			count++;
		}
	}
	t = n;
	do
	{
	    for(g = 0; g <= t - num - 1; g++)
		{
		    if(a[g] == k)
			{
			    num++;
			    for(h = g; h < t - num; h++)
				{
				    a[h] = a[h + 1];
				}
			}
		
		}
	}while(num < count);
	for(m = 0; m <= (n - count - 2); m++)
	{
		cout << a[m] << " ";
	}
	cout << a[n - count - 1] << endl;
	return 0;
}
int main()
{int *p,k,j,i,a[100000],n,m=0;
p=a;
scanf("%d",&n);
for (i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("%d",&k);
for (i=0;i<n;i++)
{
	if(*(p+i)==k)
	{
		while(*(p+i)==k)
		{
			for (j=i;j<n-m;j++)
				a[j]=a[j+1];
			m=m+1;
		}
	
	
	}
	
	
}

for (i=0;i<n-m-1;i++,p++)
printf("%d ",*p);

printf("%d",*p);


}
int main()
{
    int a[100001],n,i,j,k,d=0;
    int *p;
    p=a;
    
    scanf("%d",&n);
    for(i=0;i<n;i++)
       scanf("%d",p+i);
    scanf("%d",&k);
    for(i=0;i<n;i++)
       if(*(p+i)==k)d++;    
    for(i=0;i<n;i++)
       {while(*(p+i)==k)
   //test       d++;
          for(j=i;j<n;j++)
             *(p+j)=*(p+j+1);}
    p=a;
    printf("%d",*p);
    for(i=1;i<n-d;i++)
       printf(" %d",*(p+i));
}
//***********************************************************
//*    name: 2.cpp                                          *
//*    author:??                                          *
//*    date: 2013-10-30                                     *
//*    description?????????                        *
//***********************************************************
int main()
{
	int n,k,i,j,count=0 ;
	cin >> n ;
	int a[1000000];
	for (i = 0; i < n ; i++)
		cin >> a[i];
	cin >> k;
	for(i = 0; i < (n-count) ; i++)
	{
		if (a[i] == k)
		{
			for(j=i ;j<n-1;j++)
			{
				a[j]=a[j+1] ;
			}
			i--;
			count++ ;
		}

	}
	i=0 ;
	while(i < n-count-1)
	{
		cout << a[i] << ' ' ;
		i++;
	}
	cout << a[n-count-1] ;
	return 0 ;
}
int main()
{
	int i,j,n,m,k=0;
	scanf("%d",&n);
    int *p;
    p=(int *)malloc(sizeof(int)*n);
    for(i=0;i<n;i++)
    scanf("%d",p+i);
    scanf("%d",&m);
    for(i=0;i<n-k;i++){
    	if(*(p+i)==m){
	       k++;
		   for(j=i;j<n-k;j++)
		      *(p+j)=*(p+j+1);
           i--;
	    }    	
    }
    for(i=0;i<n-k-1;i++)
   	printf("%d ",*(p+i));
   	printf("%d",*(p+n-k-1));
}
/*
 * 5.1DeleteNumber3.cpp
 *
 *  Created on: 2012-11-8
 *      Author: ???
 *      ??????????????????????????????????????
                                    ?????????????????????????????

 *
 */
int main()
{

int n,k,i,j,a[150000],valid;                 //valid????????
   cin>>n;
  for(i=0;i<n;i++)                       //???????
         cin>>a[i];
  valid=n;                               //????????n
     for(i=0,cin>>k;i<valid;i++)         //???????
     {if(a[i]==k)                        //???????
        { for(j=i;j<valid;j++)           //??????
    	     a[j]=a[j+1];
    	      i=i-1;                     //??????????K
           valid--;}}                    //???????????????-1
     if(valid>=1)
     {for(i=0;i<valid;i++)                //???????????
      cout<<a[i]<<(i<valid-1?" ":"\n");}
     else if(valid==0)
         cout<<endl;


    return 0;
}
main()
{
  int n,i,k;
  int num=0;
  scanf("%d",&n);
  int *shuzu=(int*)malloc(sizeof(int)*n);
  for(i=0;i<n;i++)
  {
    scanf("%d",&shuzu[i]); 				  
  }
  scanf("%d",&k);
  for(i=0;i<n;i++)
  {
    if(shuzu[i]==k)
	{
	  num++; 			   
	} 				  
  }
  num=n-num;
 for(i=0;i<n;i++)
  {
    if(shuzu[i]!=k)
	{
	  num--;
	  if(num>0)
	  {
	    printf("%d ",shuzu[i]); 		   
	  }
	  if(num==0)
	  {
	    printf("%d",shuzu[i]); 			
      }		   
	} 				  
  } 
  free(shuzu);
  return 0;
}
/*
 * 1000012862_25.cpp
 *??????????
 *  Created on: 2010-10-30
 *      Author: ???
 */
int main()                               //???
{
	int n,i,k,num,t=0;                    //???????i?k?num?t
	cin>>n;                                //??????
	cout<<endl;                       //??
	int a[n];                            //????a[n],???????
        for(i=0;i<n;i++)                   //???????i
        {       
		cin>>a[i];                        //??????a[i]??
		}
        cout<<endl;                          //??
        cin>>num;                           //???????
        cout<<endl;                        //??
        for(i=0;i<n;i++)                             //???????i
        {
        	if(a[i]==num)                      //??a[i]??num
        	{
        		t++;                     //??????t????1
                for(k=i;k<n;k++)                 //???????k
                {
        		a[k]=a[k+1];                //?a[i]???????????????
        		}
                i--;                        //??????i????1??i-1????
                }
                }
        for(i=0;i<n-t-1;i++)                  //???????i
        cout<<a[i]<<" ";                        //?i<n-t-1???????a[i]
        cout<<a[i];                                 //?i=n-t-1?????a[i]
return 0;                                       //?????
}
struct LinkNode
{
       int data;
       struct LinkNode *next;
};

int k;

struct LinkNode *createList()
{
       int n, m;
       struct LinkNode *head, *p1, *p2;
       head = (struct LinkNode*) malloc(N);
       head->next = NULL;
       p2 = head;
       scanf("%d", &n);
       while (n--)
       {
             scanf("%d", &m);
             p1 = (struct LinkNode*) malloc(N);
             p1->data = m;
             p1->next = NULL;
             p2->next = p1;
             p2 = p1;
       } 
       scanf("%d", &k); 
       return head;
}
int main()
{
    struct LinkNode *head, *p, *q, *pre;
    //freopen("7.in", "r", stdin);
    //freopen("7.out", "w", stdout); 
    head = createList();
    p = head->next;
    pre = head;
    while (p != NULL)
    {
          if (p->data == k)
          {
             pre->next = p->next;
             q = p;
             p = p->next;
             free(q);
          }
          else 
          {
               pre = p;
               p = p->next;
          }
    }
    
    p = head->next;
    while (p != NULL)
    {
          q = p;
          p = p->next;
          printf("%d%s", q->data, p ? " " : "");
          free(q);
    }
    
    return 0;
}
void main()
{
		long a[1000000],t=0,i,j,n,m;
		scanf ("%ld\n",&n);
for (i=0;i<n;i++)
{
	scanf ("%ld",&a[i]);
}
scanf ("%ld",&m);
for (i=0,t=0;i<n;i++)
{
	if (a[i]==m) continue;
	else {a[n+t]=a[i];t++;}
}
for (i=n;i<n+t-1;i++)
{
	printf ("%ld ",a[i]);
}
if (t!=0)
printf ("%ld",a[n+t-1]);
}
int main()
{
	int n,a[100001],k,i,j;			//????
	cin >> n;						//??????
	for (i=1;i<=n;i++)				//??????
		cin >> a[i];
	cin >> k;						//?????????k
	i=1;
	while (i<=n)
		if (a[i]==k)				//????????
			{
				for (j=i;j<=n;j++)	//????
					a[j]=a[j+1];
				n=n-1;				//??????
			}
		else i++;
	for (i=1;i<=n-1;i++)			//????
		cout << a[i] << " ";
	cout << a[n];
	return 0;						//????
}
/*
 *  ????????.cpp
 *
 *  Created on: 2010-10-29
 *      Author: hyd
 */
main(){
	int n,i,t,k,j;
	do
		cin>>n;              //????????
	while (n>100000||n<=0);
	const int  m=n;      //??
    int a[m];
    for (i=0;i<=m-1;i++)
    	cin>>a[i];
    do
    cin>>t;              //????????
    while (t>100000||t<-100000);
    k=0;                 //k???????????
    for (i=0;i<=m-1;i++)
    {if (a[i]==t)        //???????????????????i???1
      {k++;
       for (j=i;j<=m-1;j++)
       a[j]=a[j+1];
      i--;
      }
    }

	 for (i=0;i<=m-k-2;i++) //??
      cout<<a[i]<<' ';
      cout<<a[m-k-1];

return 0;
}
/*
???????????
?????? 1200012921
???2012.10.31
*/

int main()
{
	int n, k;                             //n:????????k???????
	int i, j, m, t, l, count = 0;         //i?j?m?t?l??????count??????????
	int a[100000] = {0};                  //??????0
	cin >> n;
	for (i = 0; i <= n - 1; i++)          //??????n???
	{
		cin >> a[i];
	}
	cin >> k;                             //????????k
	for (j = 0; j <= n - 1 - count; j++)  //????????a[j]???k
	{
		if (a[j] == k)                    //??a[j]=k
		{
			do                            //?a[j]?????????????a[j]
			{
				for (m = j; m <= n - 1 - count; m++)
				{
					a[m] = a[m + 1];
				}
				count++;                 //?????????1
			}
			while (a[j] == k);           //????a[j]??k??????
		}
	}
	cout << a[0];                         //a[0]?????????????
	for (t = 1; t <= n - 1 - count; t++)
		cout <<" " << a[t];               //??????a????????
	return 0;
}