import java.util.Scanner; public class ja420 { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int a= scanner.nextInt(); //将数字转化成二进制 for (int i =31 ; i >=1 ; i-=2) { System.out.print((a>>i-1)&1); } System.out.println(); for (int i = 32; i>=1 ; i-=2) { System.out.print((a>>i-1)&1); }}}
输出一个数二进制的奇数偶数
最新推荐文章于 2024-08-18 22:26:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)