没有合适的资源?快使用搜索试试~ 我知道了~
首页定义一个整数集合类及相关运算
定义一个整数集合类及相关运算
![](https://csdnimg.cn/release/wenkucmsfe/public/img/star.98a08eaa.png)
定义一个整数集合类 添加一个元素 删去一个元素 两个集合是否相等 集合的与、差、并、交
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/1942626/bg1.jpg)
using System;
using System.Collections.Generic;
using System.Text;
namespace KS2
{
class Program
{
static void Main(string[] args)
{
IntSet s0 = new IntSet(2, 3, 4);
s0.OutPut1(s0);
Console.WriteLine("增加一个数:");
s0.Add(1);
s0.OutPut1(s0);
IntSet s1 = new IntSet(4, 5, 6);
s1.OutPut1(s1);
Console.WriteLine("减去一个数:");
s1.Sub(2);
s1.OutPut1(s1);
Console.WriteLine("并集:");
s1.OutPut1(s1.Union(s0));
Console.WriteLine("交集");
s1.OutPut1(s1.Intersection1(s0));
Console.WriteLine("差集:");
s1.OutPut1(s1.Subtraction1(s0));
Console.WriteLine("于");
Console.WriteLine(s1.Belong(s0));
start:
int n;
Console.WriteLine("输入集合1的最大项数");
n = int.Parse(Console.ReadLine());
int m;
Console.WriteLine("输入集合1的项数");
m = int.Parse(Console.ReadLine());
IntSet s2 = new IntSet(m);
s2.MaxSize = n;
s2.CurSize = m;
Console.WriteLine("输入集合1");
if (s2.CurSize > s2.MaxSize)
goto error1;
else
{
for (int i = 0; i < s2.CurSize; i++)
{
![text/x-c++](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/09d8e6df5f84429595c2a46f21b5c4b6_hello0330.jpg!1)
hello0330
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
会员权益专享
最新资源
- BSC关键绩效财务与客户指标详解
- 绘制企业战略地图:从财务到客户价值的六步法
- BSC关键绩效指标详解:财务与运营效率评估
- 手持移动数据终端:常见问题与WIFI设置指南
- 平衡计分卡(BSC):绩效管理与战略实施工具
- ESP8266智能家居控制系统设计与实现
- ESP8266在智能家居中的应用——网络家电控制系统
- BSC:平衡计分卡在绩效管理与信息技术中的应用
- 手持移动数据终端:常见问题与解决办法
- BSC模板:四大领域关键绩效指标详解(财务、客户、运营与成长)
- BSC:从绩效考核到计算机网络的关键概念
- BSC模板:四大维度关键绩效指标详解与预算达成分析
- 平衡计分卡(BSC):绩效考核与战略实施工具
- K-means聚类算法详解及其优缺点
- 平衡计分卡(BSC):从绩效考核到战略实施
- BSC:平衡计分卡与计算机网络中的应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)