ADD file via upload

main
fdzcxy212206296 1 month ago
parent 2e2a3711c0
commit 45d68a6b2e

@ -0,0 +1,13 @@
public class jinzhi {
public static void main(String[] args) {
int a = 15;
int n = 0;
int i=0;
while (a > 0) {
n = (int) (n + (a % 2) * Math.pow(10,i));
a = a / 2;
i=i+1;
}
System.out.print("十进制a转换二进制n为" + n);
}
}
Loading…
Cancel
Save