日期:2014-05-20 浏览次数:20706 次
public class Test { public static void main(String[] args){ int score=10; for(Integer i=0;i<1024;i++){ String b = i.toBinaryString(i); StringBuffer c =new StringBuffer(); for(int j=0;j<10-b.length();j++){ c.append('0'); } c.append(b); String d = c.toString(); char[] chars = d.toCharArray(); for(int k=0 ; k<10;k++){ if(chars[k]=='0'){ score -=k+1; } else{ score *=2; } } if(score==100){ System.out.println(chars); } score = 10; } } } //分数嫁错了 0010110011 0111010000 1011010000