|
楼主 |
发表于 2020-3-9 23:15:01
|
显示全部楼层
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(){};
}; |
|