| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1176 人关注过本帖
标题:一道ACM问题 请高手指教 谢谢
取消只看楼主 加入收藏
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
 问题点数:0 回复次数:5 
一道ACM问题 请高手指教 谢谢
The symmetric difference of two sets is the set of elements belonging to one but not both of the two sets. For example, if we have two sets A = {1,2,3,4,5} and B = {3,4,5,6,7,8}, then the symmetric difference of A and B is the set {1,2,6,7,8}.

Given two sets of positive integers, display their symmetric difference.



Input

A positive integer will denote the number of cases. Both sets will be input from a single line. A zero (0) marks the end of each set. There will be no more than 20 numbers in each set, and no number within a set will be repeated. Each number in a set is a positive integer less than 65535.



Output

The set of integers making up the symmetric difference of the two sets. The numbers within a set may be sorted from smaller to bigger.



Sample Input
3
1 2 3 4 5 0 3 4 5 6 7 8 0
1 2 3 0 1 2 3 0
129 34 5 6 7 0 129 0
Sample Output
{1,2,6,7,8}
{}
{5,6,7,34}
搜索更多相关主题的帖子: 指教 ACM 
2008-09-05 15:47
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
得分:0 
能具体说下思路么?本人是初学者谢谢
2008-09-05 16:03
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
得分:0 
回复 4# leeco 的帖子
那怎么样输出三个呢?
2008-09-05 16:16
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
得分:0 
有没有高人附一个完整代码?小弟在此等候
2008-09-05 17:35
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
得分:0 
回复 7# 中学者 的帖子
谢谢你 虽然看不太懂
2008-09-05 19:12
jackylin
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2008-9-5
收藏
得分:0 
那你觉得应该怎么样做呢?
2008-09-07 12:41
快速回复:一道ACM问题 请高手指教 谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019578 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved