一和任何十二数相表或得多少

在程序里经常看到一个数与0xff相与 这是要干嘛?
[问题点数:20分,结帖人keke_zkt]
在程序里经常看到一个数与0xff相与 这是要干嘛?
[问题点数:20分,结帖人keke_zkt]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2014年2月 C/C++大版内专家分月排行榜第二2013年4月 C/C++大版内专家分月排行榜第二2013年3月 C/C++大版内专家分月排行榜第二2012年12月 C/C++大版内专家分月排行榜第二2012年11月 C/C++大版内专家分月排行榜第二2012年8月 C/C++大版内专家分月排行榜第二
2014年12月 C/C++大版内专家分月排行榜第三2014年5月 C/C++大版内专家分月排行榜第三2014年3月 C/C++大版内专家分月排行榜第三2013年12月 C/C++大版内专家分月排行榜第三2013年10月 C/C++大版内专家分月排行榜第三2013年9月 C/C++大版内专家分月排行榜第三2013年7月 C/C++大版内专家分月排行榜第三2013年5月 C/C++大版内专家分月排行榜第三2013年2月 C/C++大版内专家分月排行榜第三2013年1月 C/C++大版内专家分月排行榜第三2012年9月 C/C++大版内专家分月排行榜第三
2014年2月 C/C++大版内专家分月排行榜第二2013年4月 C/C++大版内专家分月排行榜第二2013年3月 C/C++大版内专家分月排行榜第二2012年12月 C/C++大版内专家分月排行榜第二2012年11月 C/C++大版内专家分月排行榜第二2012年8月 C/C++大版内专家分月排行榜第二
2014年12月 C/C++大版内专家分月排行榜第三2014年5月 C/C++大版内专家分月排行榜第三2014年3月 C/C++大版内专家分月排行榜第三2013年12月 C/C++大版内专家分月排行榜第三2013年10月 C/C++大版内专家分月排行榜第三2013年9月 C/C++大版内专家分月排行榜第三2013年7月 C/C++大版内专家分月排行榜第三2013年5月 C/C++大版内专家分月排行榜第三2013年2月 C/C++大版内专家分月排行榜第三2013年1月 C/C++大版内专家分月排行榜第三2012年9月 C/C++大版内专家分月排行榜第三
2015年9月 VC/MFC大版内专家分月排行榜第二2015年7月 硬件/嵌入开发大版内专家分月排行榜第二2014年5月 VC/MFC大版内专家分月排行榜第二2014年3月 VC/MFC大版内专家分月排行榜第二2013年10月 VB大版内专家分月排行榜第二2013年7月 VB大版内专家分月排行榜第二2012年5月 VB大版内专家分月排行榜第二2012年4月 VB大版内专家分月排行榜第二2012年2月 VB大版内专家分月排行榜第二2011年11月 VB大版内专家分月排行榜第二
2015年11月 VC/MFC大版内专家分月排行榜第三2015年6月 VC/MFC大版内专家分月排行榜第三2015年2月 VC/MFC大版内专家分月排行榜第三2014年1月 VC/MFC大版内专家分月排行榜第三2012年3月 VB大版内专家分月排行榜第三2011年12月 VB大版内专家分月排行榜第三2011年10月 VB大版内专家分月排行榜第三
匿名用户不能发表回复!|博客分类:
给定一个数据集合,把这些数据分成和相等的两堆,输出所有可能的结果。
源数据集合--&[7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
第1种结果==& [7, 6, 1] 和 [5, 4, 3, 2]
第2种结果==& [7, 5, 2] 和 [6, 4, 3, 1]
第3种结果==& [7, 4, 3] 和 [6, 5, 2, 1]
第4种结果==& [7, 4, 2, 1] 和 [6, 5, 3]
1. 首先判断这个数据集合的和是不是偶数,只有偶数才能分成和一样的两堆数据。
2. 将数据集分成新的两个和一样的数据集合,它们的和是原来数据集和的二分之一,如SUM。得到这个值,作为期望值,
&& 使用递归的思想,(本实现使用了Stack)。如果递归过程中Stack中的数据集和为SUM,那么剩下的数据集合也是SUM,输出这两个集合。
import java.util.ArrayL
import java.util.A
import java.util.L
import java.util.S
* 给定一个数据集合,把这些数据分成和相等的两堆,输出所有可能的结果。
* 源数据集合--&[7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
* 第1种结果==& [7, 6, 1] 和 [5, 4, 3, 2]
* 第2种结果==& [7, 5, 2] 和 [6, 4, 3, 1]
* 第3种结果==& [7, 4, 3] 和 [6, 5, 2, 1]
* 第4种结果==& [7, 4, 2, 1] 和 [6, 5, 3]
* @author Eric
* @version 1.0
public class FindTwoSetsWithSameSum {
// 当前Stack中所有数据的和
private int sumInStack = 0;
private Stack&Integer& stack = new Stack&Integer&();
* 数据从大到小排列
private static void sortByDes(int[] data) {
Arrays.sort(data);
int length = data.
for (int i = 0; i & length / 2; i++) {
int temp = data[i];
data[i] = data[length - i - 1];
data[length - i - 1] =
private List&String& uniqueResult = new ArrayList&String&();
int count = 0;
public void populate(int[] data) {
* 计算数据集的和,如果不是偶数,那么直接输出“结果不存在”。
int sum = sum(data);
if (sum % 2 != 0) {
System.out.println("结果不存在!");
* 如果数据集的和为偶数,计算出平均数,为了减少递归的次数,
* 将数据从大到小排列。
int average = sum / 2;
sortByDes(data);
* 打印出数据集合的信息。
* 源数据集合--&[15,14,13,11,10,9,8,7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
printDataArray(data);
populateTargetSets(average, data, 0, data.length);
private void populateTargetSets(int sum, int[] sourceData, int begin,
int end) {
// 判断Stack中的数据和是否等于目标值,如果是则输出当前Stack中的数据
if (sumInStack == sum) {
if (!isDuplicatedResult(stack, sourceData)) {
print(stack, sourceData);
for (int currentIndex = currentIndex & currentIndex++) {
* 如果当前Stack中的和加上当前index的数据小于等于目标值, 那么将当前的index的数据添加到Stack中去,
* 同时,将当前Stack中所有数据的和加上新添加到Stack中的数值
if (sumInStack + sourceData[currentIndex] &= sum) {
stack.push(sourceData[currentIndex]);
sumInStack += sourceData[currentIndex];
// 当前index加上1,递归调用本身
populateTargetSets(sum, sourceData, currentIndex + 1, end);
sumInStack -= (Integer) stack.pop();
private boolean isDuplicatedResult(Stack&Integer& stack, int[] sourceData) {
return uniqueResult.contains(stack.toString());
private void print(Stack&Integer& stack, int[] sourceData) {
printIndexInfor();
printStack(stack);
printRemainingData(stack, sourceData);
private void printIndexInfor() {
System.out.print("第");
System.out.print(++count);
System.out.print("种结果==& ");
private void printRemainingData(Stack&Integer& stack, int[] sourceData) {
List&Integer& list = new ArrayList&Integer&();
for (int element : sourceData) {
list.add(element);
for (int element : stack) {
list.remove(new Integer(element));
System.out.print(" 和 ");
System.out.println(list.toString());
uniqueResult.add(stack.toString());
uniqueResult.add(list.toString());
private void printStack(Stack&Integer& stack) {
System.out.print("");
System.out.print(stack.toString());
private void printDataArray(int[] sourceData) {
StringBuilder sb = new StringBuilder();
sb.append('[');
for (int element : sourceData) {
sb.append(element);
sb.append(',');
sb.setCharAt(sb.length() - 1, ']');
System.out.print("源数据集合--&");
System.out.print(sb.toString());
System.out.println(" 分成和相等的两堆数据,有如下几种情况!");
System.out.println();
* 数据求和。
private int sum(int[] data) {
int sum = 0;
for (int element : data) {
public static void main(String[] args) {
int[] sourceData = { 1, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 13, 14, 15 };
FindTwoSetsWithSameSum finder = new FindTwoSetsWithSameSum();
finder.populate(sourceData);
源数据集合--&[15,14,13,11,10,9,8,7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
第1种结果==& [15, 14, 13, 11, 1] 和 [10, 9, 8, 7, 6, 5, 4, 3, 2]
第2种结果==& [15, 14, 13, 10, 2] 和 [11, 9, 8, 7, 6, 5, 4, 3, 1]
第3种结果==& [15, 14, 13, 9, 3] 和 [11, 10, 8, 7, 6, 5, 4, 2, 1]
第4种结果==& [15, 14, 13, 9, 2, 1] 和 [11, 10, 8, 7, 6, 5, 4, 3]
第5种结果==& [15, 14, 13, 8, 4] 和 [11, 10, 9, 7, 6, 5, 3, 2, 1]
第6种结果==& [15, 14, 13, 8, 3, 1] 和 [11, 10, 9, 7, 6, 5, 4, 2]
第7种结果==& [15, 14, 13, 7, 5] 和 [11, 10, 9, 8, 6, 4, 3, 2, 1]
第8种结果==& [15, 14, 13, 7, 4, 1] 和 [11, 10, 9, 8, 6, 5, 3, 2]
第9种结果==& [15, 14, 13, 7, 3, 2] 和 [11, 10, 9, 8, 6, 5, 4, 1]
第10种结果==& [15, 14, 13, 6, 5, 1] 和 [11, 10, 9, 8, 7, 4, 3, 2]
第11种结果==& [15, 14, 13, 6, 4, 2] 和 [11, 10, 9, 8, 7, 5, 3, 1]
第12种结果==& [15, 14, 13, 6, 3, 2, 1] 和 [11, 10, 9, 8, 7, 5, 4]
第13种结果==& [15, 14, 13, 5, 4, 3] 和 [11, 10, 9, 8, 7, 6, 2, 1]
第14种结果==& [15, 14, 13, 5, 4, 2, 1] 和 [11, 10, 9, 8, 7, 6, 3]
第15种结果==& [15, 14, 11, 10, 4] 和 [13, 9, 8, 7, 6, 5, 3, 2, 1]
第16种结果==& [15, 14, 11, 10, 3, 1] 和 [13, 9, 8, 7, 6, 5, 4, 2]
第17种结果==& [15, 14, 11, 9, 5] 和 [13, 10, 8, 7, 6, 4, 3, 2, 1]
第18种结果==& [15, 14, 11, 9, 4, 1] 和 [13, 10, 8, 7, 6, 5, 3, 2]
第19种结果==& [15, 14, 11, 9, 3, 2] 和 [13, 10, 8, 7, 6, 5, 4, 1]
第20种结果==& [15, 14, 11, 8, 6] 和 [13, 10, 9, 7, 5, 4, 3, 2, 1]
第21种结果==& [15, 14, 11, 8, 5, 1] 和 [13, 10, 9, 7, 6, 4, 3, 2]
第22种结果==& [15, 14, 11, 8, 4, 2] 和 [13, 10, 9, 7, 6, 5, 3, 1]
第23种结果==& [15, 14, 11, 8, 3, 2, 1] 和 [13, 10, 9, 7, 6, 5, 4]
第24种结果==& [15, 14, 11, 7, 6, 1] 和 [13, 10, 9, 8, 5, 4, 3, 2]
第25种结果==& [15, 14, 11, 7, 5, 2] 和 [13, 10, 9, 8, 6, 4, 3, 1]
第26种结果==& [15, 14, 11, 7, 4, 3] 和 [13, 10, 9, 8, 6, 5, 2, 1]
第27种结果==& [15, 14, 11, 7, 4, 2, 1] 和 [13, 10, 9, 8, 6, 5, 3]
第28种结果==& [15, 14, 11, 6, 5, 3] 和 [13, 10, 9, 8, 7, 4, 2, 1]
第29种结果==& [15, 14, 11, 6, 5, 2, 1] 和 [13, 10, 9, 8, 7, 4, 3]
第30种结果==& [15, 14, 11, 6, 4, 3, 1] 和 [13, 10, 9, 8, 7, 5, 2]
第31种结果==& [15, 14, 11, 5, 4, 3, 2] 和 [13, 10, 9, 8, 7, 6, 1]
第32种结果==& [15, 14, 10, 9, 6] 和 [13, 11, 8, 7, 5, 4, 3, 2, 1]
第33种结果==& [15, 14, 10, 9, 5, 1] 和 [13, 11, 8, 7, 6, 4, 3, 2]
第34种结果==& [15, 14, 10, 9, 4, 2] 和 [13, 11, 8, 7, 6, 5, 3, 1]
第35种结果==& [15, 14, 10, 9, 3, 2, 1] 和 [13, 11, 8, 7, 6, 5, 4]
第36种结果==& [15, 14, 10, 8, 7] 和 [13, 11, 9, 6, 5, 4, 3, 2, 1]
第37种结果==& [15, 14, 10, 8, 6, 1] 和 [13, 11, 9, 7, 5, 4, 3, 2]
第38种结果==& [15, 14, 10, 8, 5, 2] 和 [13, 11, 9, 7, 6, 4, 3, 1]
第39种结果==& [15, 14, 10, 8, 4, 3] 和 [13, 11, 9, 7, 6, 5, 2, 1]
第40种结果==& [15, 14, 10, 8, 4, 2, 1] 和 [13, 11, 9, 7, 6, 5, 3]
第41种结果==& [15, 14, 10, 7, 6, 2] 和 [13, 11, 9, 8, 5, 4, 3, 1]
第42种结果==& [15, 14, 10, 7, 5, 3] 和 [13, 11, 9, 8, 6, 4, 2, 1]
第43种结果==& [15, 14, 10, 7, 5, 2, 1] 和 [13, 11, 9, 8, 6, 4, 3]
第44种结果==& [15, 14, 10, 7, 4, 3, 1] 和 [13, 11, 9, 8, 6, 5, 2]
第45种结果==& [15, 14, 10, 6, 5, 4] 和 [13, 11, 9, 8, 7, 3, 2, 1]
第46种结果==& [15, 14, 10, 6, 5, 3, 1] 和 [13, 11, 9, 8, 7, 4, 2]
第47种结果==& [15, 14, 10, 6, 4, 3, 2] 和 [13, 11, 9, 8, 7, 5, 1]
第48种结果==& [15, 14, 10, 5, 4, 3, 2, 1] 和 [13, 11, 9, 8, 7, 6]
第49种结果==& [15, 14, 9, 8, 7, 1] 和 [13, 11, 10, 6, 5, 4, 3, 2]
第50种结果==& [15, 14, 9, 8, 6, 2] 和 [13, 11, 10, 7, 5, 4, 3, 1]
第51种结果==& [15, 14, 9, 8, 5, 3] 和 [13, 11, 10, 7, 6, 4, 2, 1]
第52种结果==& [15, 14, 9, 8, 5, 2, 1] 和 [13, 11, 10, 7, 6, 4, 3]
第53种结果==& [15, 14, 9, 8, 4, 3, 1] 和 [13, 11, 10, 7, 6, 5, 2]
第54种结果==& [15, 14, 9, 7, 6, 3] 和 [13, 11, 10, 8, 5, 4, 2, 1]
第55种结果==& [15, 14, 9, 7, 6, 2, 1] 和 [13, 11, 10, 8, 5, 4, 3]
第56种结果==& [15, 14, 9, 7, 5, 4] 和 [13, 11, 10, 8, 6, 3, 2, 1]
第57种结果==& [15, 14, 9, 7, 5, 3, 1] 和 [13, 11, 10, 8, 6, 4, 2]
第58种结果==& [15, 14, 9, 7, 4, 3, 2] 和 [13, 11, 10, 8, 6, 5, 1]
第59种结果==& [15, 14, 9, 6, 5, 4, 1] 和 [13, 11, 10, 8, 7, 3, 2]
第60种结果==& [15, 14, 9, 6, 5, 3, 2] 和 [13, 11, 10, 8, 7, 4, 1]
第61种结果==& [15, 14, 9, 6, 4, 3, 2, 1] 和 [13, 11, 10, 8, 7, 5]
第62种结果==& [15, 14, 8, 7, 6, 4] 和 [13, 11, 10, 9, 5, 3, 2, 1]
第63种结果==& [15, 14, 8, 7, 6, 3, 1] 和 [13, 11, 10, 9, 5, 4, 2]
第64种结果==& [15, 14, 8, 7, 5, 4, 1] 和 [13, 11, 10, 9, 6, 3, 2]
第65种结果==& [15, 14, 8, 7, 5, 3, 2] 和 [13, 11, 10, 9, 6, 4, 1]
第66种结果==& [15, 14, 8, 7, 4, 3, 2, 1] 和 [13, 11, 10, 9, 6, 5]
第67种结果==& [15, 14, 8, 6, 5, 4, 2] 和 [13, 11, 10, 9, 7, 3, 1]
第68种结果==& [15, 14, 8, 6, 5, 3, 2, 1] 和 [13, 11, 10, 9, 7, 4]
第69种结果==& [15, 14, 7, 6, 5, 4, 3] 和 [13, 11, 10, 9, 8, 2, 1]
第70种结果==& [15, 14, 7, 6, 5, 4, 2, 1] 和 [13, 11, 10, 9, 8, 3]
第71种结果==& [15, 13, 11, 10, 5] 和 [14, 9, 8, 7, 6, 4, 3, 2, 1]
第72种结果==& [15, 13, 11, 10, 4, 1] 和 [14, 9, 8, 7, 6, 5, 3, 2]
第73种结果==& [15, 13, 11, 10, 3, 2] 和 [14, 9, 8, 7, 6, 5, 4, 1]
第74种结果==& [15, 13, 11, 9, 6] 和 [14, 10, 8, 7, 5, 4, 3, 2, 1]
第75种结果==& [15, 13, 11, 9, 5, 1] 和 [14, 10, 8, 7, 6, 4, 3, 2]
第76种结果==& [15, 13, 11, 9, 4, 2] 和 [14, 10, 8, 7, 6, 5, 3, 1]
第77种结果==& [15, 13, 11, 9, 3, 2, 1] 和 [14, 10, 8, 7, 6, 5, 4]
第78种结果==& [15, 13, 11, 8, 7] 和 [14, 10, 9, 6, 5, 4, 3, 2, 1]
第79种结果==& [15, 13, 11, 8, 6, 1] 和 [14, 10, 9, 7, 5, 4, 3, 2]
第80种结果==& [15, 13, 11, 8, 5, 2] 和 [14, 10, 9, 7, 6, 4, 3, 1]
第81种结果==& [15, 13, 11, 8, 4, 3] 和 [14, 10, 9, 7, 6, 5, 2, 1]
第82种结果==& [15, 13, 11, 8, 4, 2, 1] 和 [14, 10, 9, 7, 6, 5, 3]
第83种结果==& [15, 13, 11, 7, 6, 2] 和 [14, 10, 9, 8, 5, 4, 3, 1]
第84种结果==& [15, 13, 11, 7, 5, 3] 和 [14, 10, 9, 8, 6, 4, 2, 1]
第85种结果==& [15, 13, 11, 7, 5, 2, 1] 和 [14, 10, 9, 8, 6, 4, 3]
第86种结果==& [15, 13, 11, 7, 4, 3, 1] 和 [14, 10, 9, 8, 6, 5, 2]
第87种结果==& [15, 13, 11, 6, 5, 4] 和 [14, 10, 9, 8, 7, 3, 2, 1]
第88种结果==& [15, 13, 11, 6, 5, 3, 1] 和 [14, 10, 9, 8, 7, 4, 2]
第89种结果==& [15, 13, 11, 6, 4, 3, 2] 和 [14, 10, 9, 8, 7, 5, 1]
第90种结果==& [15, 13, 11, 5, 4, 3, 2, 1] 和 [14, 10, 9, 8, 7, 6]
第91种结果==& [15, 13, 10, 9, 7] 和 [14, 11, 8, 6, 5, 4, 3, 2, 1]
第92种结果==& [15, 13, 10, 9, 6, 1] 和 [14, 11, 8, 7, 5, 4, 3, 2]
第93种结果==& [15, 13, 10, 9, 5, 2] 和 [14, 11, 8, 7, 6, 4, 3, 1]
第94种结果==& [15, 13, 10, 9, 4, 3] 和 [14, 11, 8, 7, 6, 5, 2, 1]
第95种结果==& [15, 13, 10, 9, 4, 2, 1] 和 [14, 11, 8, 7, 6, 5, 3]
第96种结果==& [15, 13, 10, 8, 7, 1] 和 [14, 11, 9, 6, 5, 4, 3, 2]
第97种结果==& [15, 13, 10, 8, 6, 2] 和 [14, 11, 9, 7, 5, 4, 3, 1]
第98种结果==& [15, 13, 10, 8, 5, 3] 和 [14, 11, 9, 7, 6, 4, 2, 1]
第99种结果==& [15, 13, 10, 8, 5, 2, 1] 和 [14, 11, 9, 7, 6, 4, 3]
第100种结果==& [15, 13, 10, 8, 4, 3, 1] 和 [14, 11, 9, 7, 6, 5, 2]
第101种结果==& [15, 13, 10, 7, 6, 3] 和 [14, 11, 9, 8, 5, 4, 2, 1]
第102种结果==& [15, 13, 10, 7, 6, 2, 1] 和 [14, 11, 9, 8, 5, 4, 3]
第103种结果==& [15, 13, 10, 7, 5, 4] 和 [14, 11, 9, 8, 6, 3, 2, 1]
第104种结果==& [15, 13, 10, 7, 5, 3, 1] 和 [14, 11, 9, 8, 6, 4, 2]
第105种结果==& [15, 13, 10, 7, 4, 3, 2] 和 [14, 11, 9, 8, 6, 5, 1]
第106种结果==& [15, 13, 10, 6, 5, 4, 1] 和 [14, 11, 9, 8, 7, 3, 2]
第107种结果==& [15, 13, 10, 6, 5, 3, 2] 和 [14, 11, 9, 8, 7, 4, 1]
第108种结果==& [15, 13, 10, 6, 4, 3, 2, 1] 和 [14, 11, 9, 8, 7, 5]
第109种结果==& [15, 13, 9, 8, 7, 2] 和 [14, 11, 10, 6, 5, 4, 3, 1]
第110种结果==& [15, 13, 9, 8, 6, 3] 和 [14, 11, 10, 7, 5, 4, 2, 1]
第111种结果==& [15, 13, 9, 8, 6, 2, 1] 和 [14, 11, 10, 7, 5, 4, 3]
第112种结果==& [15, 13, 9, 8, 5, 4] 和 [14, 11, 10, 7, 6, 3, 2, 1]
第113种结果==& [15, 13, 9, 8, 5, 3, 1] 和 [14, 11, 10, 7, 6, 4, 2]
第114种结果==& [15, 13, 9, 8, 4, 3, 2] 和 [14, 11, 10, 7, 6, 5, 1]
第115种结果==& [15, 13, 9, 7, 6, 4] 和 [14, 11, 10, 8, 5, 3, 2, 1]
第116种结果==& [15, 13, 9, 7, 6, 3, 1] 和 [14, 11, 10, 8, 5, 4, 2]
第117种结果==& [15, 13, 9, 7, 5, 4, 1] 和 [14, 11, 10, 8, 6, 3, 2]
第118种结果==& [15, 13, 9, 7, 5, 3, 2] 和 [14, 11, 10, 8, 6, 4, 1]
第119种结果==& [15, 13, 9, 7, 4, 3, 2, 1] 和 [14, 11, 10, 8, 6, 5]
第120种结果==& [15, 13, 9, 6, 5, 4, 2] 和 [14, 11, 10, 8, 7, 3, 1]
第121种结果==& [15, 13, 9, 6, 5, 3, 2, 1] 和 [14, 11, 10, 8, 7, 4]
第122种结果==& [15, 13, 8, 7, 6, 5] 和 [14, 11, 10, 9, 4, 3, 2, 1]
第123种结果==& [15, 13, 8, 7, 6, 4, 1] 和 [14, 11, 10, 9, 5, 3, 2]
第124种结果==& [15, 13, 8, 7, 6, 3, 2] 和 [14, 11, 10, 9, 5, 4, 1]
第125种结果==& [15, 13, 8, 7, 5, 4, 2] 和 [14, 11, 10, 9, 6, 3, 1]
第126种结果==& [15, 13, 8, 7, 5, 3, 2, 1] 和 [14, 11, 10, 9, 6, 4]
第127种结果==& [15, 13, 8, 6, 5, 4, 3] 和 [14, 11, 10, 9, 7, 2, 1]
第128种结果==& [15, 13, 8, 6, 5, 4, 2, 1] 和 [14, 11, 10, 9, 7, 3]
第129种结果==& [15, 13, 7, 6, 5, 4, 3, 1] 和 [14, 11, 10, 9, 8, 2]
第130种结果==& [15, 11, 10, 9, 8, 1] 和 [14, 13, 7, 6, 5, 4, 3, 2]
第131种结果==& [15, 11, 10, 9, 7, 2] 和 [14, 13, 8, 6, 5, 4, 3, 1]
第132种结果==& [15, 11, 10, 9, 6, 3] 和 [14, 13, 8, 7, 5, 4, 2, 1]
第133种结果==& [15, 11, 10, 9, 6, 2, 1] 和 [14, 13, 8, 7, 5, 4, 3]
第134种结果==& [15, 11, 10, 9, 5, 4] 和 [14, 13, 8, 7, 6, 3, 2, 1]
第135种结果==& [15, 11, 10, 9, 5, 3, 1] 和 [14, 13, 8, 7, 6, 4, 2]
第136种结果==& [15, 11, 10, 9, 4, 3, 2] 和 [14, 13, 8, 7, 6, 5, 1]
第137种结果==& [15, 11, 10, 8, 7, 3] 和 [14, 13, 9, 6, 5, 4, 2, 1]
第138种结果==& [15, 11, 10, 8, 7, 2, 1] 和 [14, 13, 9, 6, 5, 4, 3]
第139种结果==& [15, 11, 10, 8, 6, 4] 和 [14, 13, 9, 7, 5, 3, 2, 1]
第140种结果==& [15, 11, 10, 8, 6, 3, 1] 和 [14, 13, 9, 7, 5, 4, 2]
第141种结果==& [15, 11, 10, 8, 5, 4, 1] 和 [14, 13, 9, 7, 6, 3, 2]
第142种结果==& [15, 11, 10, 8, 5, 3, 2] 和 [14, 13, 9, 7, 6, 4, 1]
第143种结果==& [15, 11, 10, 8, 4, 3, 2, 1] 和 [14, 13, 9, 7, 6, 5]
第144种结果==& [15, 11, 10, 7, 6, 5] 和 [14, 13, 9, 8, 4, 3, 2, 1]
第145种结果==& [15, 11, 10, 7, 6, 4, 1] 和 [14, 13, 9, 8, 5, 3, 2]
第146种结果==& [15, 11, 10, 7, 6, 3, 2] 和 [14, 13, 9, 8, 5, 4, 1]
第147种结果==& [15, 11, 10, 7, 5, 4, 2] 和 [14, 13, 9, 8, 6, 3, 1]
第148种结果==& [15, 11, 10, 7, 5, 3, 2, 1] 和 [14, 13, 9, 8, 6, 4]
第149种结果==& [15, 11, 10, 6, 5, 4, 3] 和 [14, 13, 9, 8, 7, 2, 1]
第150种结果==& [15, 11, 10, 6, 5, 4, 2, 1] 和 [14, 13, 9, 8, 7, 3]
第151种结果==& [15, 11, 9, 8, 7, 4] 和 [14, 13, 10, 6, 5, 3, 2, 1]
第152种结果==& [15, 11, 9, 8, 7, 3, 1] 和 [14, 13, 10, 6, 5, 4, 2]
第153种结果==& [15, 11, 9, 8, 6, 5] 和 [14, 13, 10, 7, 4, 3, 2, 1]
第154种结果==& [15, 11, 9, 8, 6, 4, 1] 和 [14, 13, 10, 7, 5, 3, 2]
第155种结果==& [15, 11, 9, 8, 6, 3, 2] 和 [14, 13, 10, 7, 5, 4, 1]
第156种结果==& [15, 11, 9, 8, 5, 4, 2] 和 [14, 13, 10, 7, 6, 3, 1]
第157种结果==& [15, 11, 9, 8, 5, 3, 2, 1] 和 [14, 13, 10, 7, 6, 4]
第158种结果==& [15, 11, 9, 7, 6, 5, 1] 和 [14, 13, 10, 8, 4, 3, 2]
第159种结果==& [15, 11, 9, 7, 6, 4, 2] 和 [14, 13, 10, 8, 5, 3, 1]
第160种结果==& [15, 11, 9, 7, 6, 3, 2, 1] 和 [14, 13, 10, 8, 5, 4]
第161种结果==& [15, 11, 9, 7, 5, 4, 3] 和 [14, 13, 10, 8, 6, 2, 1]
第162种结果==& [15, 11, 9, 7, 5, 4, 2, 1] 和 [14, 13, 10, 8, 6, 3]
第163种结果==& [15, 11, 9, 6, 5, 4, 3, 1] 和 [14, 13, 10, 8, 7, 2]
第164种结果==& [15, 11, 8, 7, 6, 5, 2] 和 [14, 13, 10, 9, 4, 3, 1]
第165种结果==& [15, 11, 8, 7, 6, 4, 3] 和 [14, 13, 10, 9, 5, 2, 1]
第166种结果==& [15, 11, 8, 7, 6, 4, 2, 1] 和 [14, 13, 10, 9, 5, 3]
第167种结果==& [15, 11, 8, 7, 5, 4, 3, 1] 和 [14, 13, 10, 9, 6, 2]
第168种结果==& [15, 11, 8, 6, 5, 4, 3, 2] 和 [14, 13, 10, 9, 7, 1]
第169种结果==& [15, 11, 7, 6, 5, 4, 3, 2, 1] 和 [14, 13, 10, 9, 8]
第170种结果==& [15, 10, 9, 8, 7, 5] 和 [14, 13, 11, 6, 4, 3, 2, 1]
第171种结果==& [15, 10, 9, 8, 7, 4, 1] 和 [14, 13, 11, 6, 5, 3, 2]
第172种结果==& [15, 10, 9, 8, 7, 3, 2] 和 [14, 13, 11, 6, 5, 4, 1]
第173种结果==& [15, 10, 9, 8, 6, 5, 1] 和 [14, 13, 11, 7, 4, 3, 2]
第174种结果==& [15, 10, 9, 8, 6, 4, 2] 和 [14, 13, 11, 7, 5, 3, 1]
第175种结果==& [15, 10, 9, 8, 6, 3, 2, 1] 和 [14, 13, 11, 7, 5, 4]
第176种结果==& [15, 10, 9, 8, 5, 4, 3] 和 [14, 13, 11, 7, 6, 2, 1]
第177种结果==& [15, 10, 9, 8, 5, 4, 2, 1] 和 [14, 13, 11, 7, 6, 3]
第178种结果==& [15, 10, 9, 7, 6, 5, 2] 和 [14, 13, 11, 8, 4, 3, 1]
第179种结果==& [15, 10, 9, 7, 6, 4, 3] 和 [14, 13, 11, 8, 5, 2, 1]
第180种结果==& [15, 10, 9, 7, 6, 4, 2, 1] 和 [14, 13, 11, 8, 5, 3]
第181种结果==& [15, 10, 9, 7, 5, 4, 3, 1] 和 [14, 13, 11, 8, 6, 2]
第182种结果==& [15, 10, 9, 6, 5, 4, 3, 2] 和 [14, 13, 11, 8, 7, 1]
第183种结果==& [15, 10, 8, 7, 6, 5, 3] 和 [14, 13, 11, 9, 4, 2, 1]
第184种结果==& [15, 10, 8, 7, 6, 5, 2, 1] 和 [14, 13, 11, 9, 4, 3]
第185种结果==& [15, 10, 8, 7, 6, 4, 3, 1] 和 [14, 13, 11, 9, 5, 2]
第186种结果==& [15, 10, 8, 7, 5, 4, 3, 2] 和 [14, 13, 11, 9, 6, 1]
第187种结果==& [15, 10, 8, 6, 5, 4, 3, 2, 1] 和 [14, 13, 11, 9, 7]
第188种结果==& [15, 9, 8, 7, 6, 5, 4] 和 [14, 13, 11, 10, 3, 2, 1]
第189种结果==& [15, 9, 8, 7, 6, 5, 3, 1] 和 [14, 13, 11, 10, 4, 2]
第190种结果==& [15, 9, 8, 7, 6, 4, 3, 2] 和 [14, 13, 11, 10, 5, 1]
第191种结果==& [15, 9, 8, 7, 5, 4, 3, 2, 1] 和 [14, 13, 11, 10, 6]
MouseLearnJava
浏览: 241311 次
来自: 杭州
sunwang810812 写道我运行了这个例子,怎么结果是这 ...
simpleDean 写道请问,Logger.setLevel ...
我运行了这个例子,怎么结果是这样的:2号车泊车6号车泊车5号车 ...
nanjiwubing123 写道参考你的用法,用如下方式实现 ...
SurnameDictionary文章我没看完,现在懂了
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'欲使十二个数的和为零,其中正数的和的绝对值与负数的和的绝对值必须相等,先算出总和,再取总和的一半,在和为一半的数前加正号,其余的数前添负号即可解决问题;此外我们还可发现,由于最大的三个数,,其和,因此必须再增加一个数,才有解答,也就是说:添加负号的数至少要有四个;反过来,根据对偶律得:添加负号的数最多不超过八个.掌握了上述几条规律,我们就能够在很短的时间内得到许多解答,其总数是个.
解:;不能.因为,若要改变这些数前的符号使之代数和为,则正数,负数之和需为和,易知偶数之和为偶数不为奇数,所以不能改变钟面上的数.由于最大的三个数,,其和,因此必须再增加一个数,才有解答,也就是说:添加负号的数至少要有四个;反过来,根据对偶律得:添加负号的数最多不超过八个.掌握了上述几条规律,我们就能够在很短的时间内得到许多解答,其总数是个.
本题考查了有理数的加减混合运算.认真审题,找出规律:个正数绝对值的和等于,,,,,,这个数的和的一半,是解决此题的关键所在.
3656@@3@@@@规律型:数字的变化类@@@@@@241@@Math@@Junior@@$241@@2@@@@代数式@@@@@@49@@Math@@Junior@@$49@@1@@@@数与式@@@@@@7@@Math@@Junior@@$7@@0@@@@初中数学@@@@@@-1@@Math@@Junior@@
第三大题,第5小题
求解答 学习搜索引擎 | 钟面数字问题如图,钟面上有1,2,3,...,11,12这12个数字.(1)试在某些数的前面添加负号,使它们的代数和为零(2)能否改变钟面上的数,比如只剩下6个偶数,仍按第(1)小题的要求来做?[思路探究](1)我们先试着选定任意几个数字,在其前面添加负号,如-12-11-10+9+8+7+6-5+4+3+2+1-2.这当然不是我们要的答案,但我们可以将其调整,比如改变1前面的符号,得-12-11-10+9+8+7+6-5+4+3+2-1-0.用这种方法当然可以得到许多答案,但我们并不满足.我们希望寻找其中的规律,使我们能找到更多的解答.我们发现:在调整符号的过程中,若将一个正数变号,12个数的代数和就减少这个正数的两倍;若将一个负数变号,12个数的代数和就增加这个负数的绝对值的两倍.要使12个数的代数和为零,其中正数的和的绝对值必须与负数的和的绝对值相等,均为12个数之和的-半,即等于39.由此,我们只要找到几个和为39的数,将这些数添上负号即可.由于最大3个数之和为33<39,因此必须再添上一个6才有解答,所以添加负号的数至少要有4个.同理可知,添加负号的数最多不超过8个.根据以上规律,就能在很短的时间内得到许多解答,但是要写出所有解答,还必须把答案作适当的分类.本题共有124个解答,亲爱的读者,你能写出这124个解答来吗?(2)因为2+4+6+8+10+12-42,它的一半为21,而奇数不可能通过偶数求和得到,所以只剩下6个偶数时,不能按第(1)小题的要求来做.

我要回帖

更多关于 12属相 的文章

 

随机推荐