#include<iostream>
using namespace std;
/*class<T>
class seqlist
{
public:
seqlist(int n);
~seqlist();
private:
T *a;
}
seqlist::seqlist(int n)
{
a=new
*/
template<class T>
void reverse(T a[],int n)
{
int i,j;
T temp;
for(i=0,j=n-1;i<=j;i++,j--)
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
template<class T>
void deletex(T a[],T x,int &n)
{
int i=0,j=0;
T *b=new T[n];
for(i=0;i<n;i++)
b[i]=a[i];
for(i=0;i<n;i++)
{
if(b[i]!=x)
a[j++]=b[i];
}
n=j;
delete []b;
}
template<class T>
void output(T a[],int n)
{
int i;
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
cout<<endl;
}
int main()
{
int *a,x;
char *b,y;
double *c,z;
int i,n;
cin>>n;
a=new int[n];
for(i=0;i<n;i++)
cin>>a[i];
cin>>x;
reverse(a,n);
output(a,n);
deletex(a,x,n);
output(a,n);
cin>>n;
b=new char[n];
for(i=0;i<n;i++)
cin>>b[i];
cin>>y;
reverse(b,n);
output(b,n);
deletex(b,y,n);
output(b,n);
cin>>n;
c=new double[n];
for(i=0;i<n;i++)
cin>>c[i];
cin>>z;
reverse(c,n);
output(c,n);
deletex(c,z,n);
output(c,n);
delete []a;
delete []b;
delete []c;
return 0;
}
10-05