摘要:
这道题要利用101010来&。如下答案:public class Exchange { public int exchangeOddEven(int x) { // write code here int res =(((x & 0x55555555)>1)); ... 阅读全文
摘要:
自己的: public static int calcCost(int A,int B){ int ans = 1; int temp = A ^ B; while(temp != 1){ if(temp % 2 == 1) an... 阅读全文
摘要:
public static String printBin(double num) { StringBuffer str = new StringBuffer(); str.append('0'); str.appe... 阅读全文
摘要:
public class Solution { public static int binInsert(int n, int m, int i, int j) { // write code here// return n | (m << i); in... 阅读全文