#include <iostream>
using namespace std;
const int Max=100;

class Seqlist{
public:
Seqlist(int a[],int n);
void Get(int i);
private:
int length;
int b[Max];
};
Seqlist::Seqlist(int a[],int n)
{
for(int i=0;i<n;i++)
{
b[i]=a[i];
cout<<b[i]<<" ";
}length=n;
}
void Seqlist::Get(int x){
for(int i=0;i<length;i++)
{
if(x==b[i])
{ cout<<i;
}
else
{
}
}
}
void main()
{ int n;
int *a;
int x;
cout<<"please enter two number:"<<endl;
cin>>n;
cin>>x;
a=new int[n];
cout<<"enter "<<n<<" numbers:";
for(int i=0;i<n;i++)
cin>>a[i];
Seqlist s(a,n);
s.Get(x);
}

呵呵,謝謝,更改過來啦,