给定一个int x,交换其二进制的奇数位和偶数位,并返回交换后的数int。 测试样例: 10 返回:5
加载中...
import java.util.*; public class Exchange { public int exchangeOddEven(int x) { // write code here } }
class Exchange { public: int exchangeOddEven(int x) { // write code here } };
# -*- coding:utf-8 -*- class Exchange: def exchangeOddEven(self, x): # write code here
class Exchange { public int exchangeOddEven(int x) { // write code here } }