我需要Codings来实现以下概念 [英] I need the Codings for the following concept

查看:46
本文介绍了我需要Codings来实现以下概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

a = 1,2,3,4,5,6,7,8,9

b = 2,4,8,0

结合两个变数(整数分配给这些变量)我需要输出如下

输出:

1,2,3,4,5,6,7,8,9,0

解决方案

你昨天没有发布同样的问题。不久之后它被删除。



我的建议是使用 std :: set< int> 收集两套的所有元素。而你所谓的合并可能是两套的结合。



现在,尝试一下,如果你遇到问题,请告诉我们你到目前为止的代码

a= 1,2,3,4,5,6,7,8,9
b=2,4,8,0
by combining two varables(integers assign to these variables) i need the output as follows
output:
1,2,3,4,5,6,7,8,9,0

解决方案

Haven''t you posted that same question yesterday. It was deleted a short while later.

My advice was to use std::set<int> to collect all the elements of your two sets. And what you call "combining" is probably the union of the two sets.

Now, try that and if you run into problems show us the code you have so far.


这篇关于我需要Codings来实现以下概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆