From 9a4d7b249ead3d1d27b46bf2d47a3e3aba16ce9a Mon Sep 17 00:00:00 2001 From: guixu0320 <3488249364@qq.com> Date: Wed, 16 Oct 2024 12:09:56 +0800 Subject: [PATCH] jinzhi --- jinzhi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jinzhi.java b/jinzhi.java index 39b9f59..edc6306 100644 --- a/jinzhi.java +++ b/jinzhi.java @@ -1,13 +1,13 @@ public class jinzhi { public static void main(String[] args) { int a = 15; - int n = 0; + int x = 0; int i=0; while (a > 0) { - n = (int) (n + (a % 2) * Math.pow(10,i)); + x = (int) (x + (a % 2) * Math.pow(10,i)); a = a / 2; i=i+1; } - System.out.print("jinzhi十进制a转换二进制n为:" + n); + System.out.print("jinzhi11111十进制a转换二进制x为:" + x); } } \ No newline at end of file