|
class IntSet
{
private:
vector<int> Ints;
int element[100];
int n,seeknumber;
public:
IntSet()
{
cout<<"输入如下个整数:";
cin>>n;
for (long i = 0; i < n; i++)
{
cin>>element[i];
Ints.push_back(element[i]);
};
cout<<endl<<Ints[0];
};
Empty(){Ints.clear();};
Isempty(){if (Ints.empty()) cout<<"集合为空!"<<endl;};
bool Ismemberof()
{
cout<<"判断此数是否在集合内部,请输入此数:";
cin>>seeknumber;
for (long j=0;j<n;j++)
if (Ints[j] == seeknumber) return true ;
};
Add(){};
Sub(){};
Isequal(){};
Intersection(){};
Merge(){};
Print(){};
};
对题目而言我这个程序对吗?还有什么欠缺的地方希望大家给我指点以下!我在这里谢谢大家了! |
|