public class Test {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		//打印整数的二进制表示
		System.out.println("请输入一个整数 将转为二进制数");
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		for(int i=0;i<32;i++) {
			int t = (a & 0x80000000 >>> i) >>>(31-i);
			System.out.print(t);
		}
	}

}

打印整数的二进制

相关文章:

  • 2021-11-22
  • 2021-12-15
  • 2022-12-23
  • 2021-07-21
  • 2021-10-25
  • 2021-09-12
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-08-09
  • 2022-01-19
相关资源
相似解决方案