write a program that converts a number in base 10 to its equ
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/17 18:01:20
write a program that converts a number in base 10 to its equivalent in base 2.
public class Du {
public static void main(String[] args) {
int num = 15;//十进制
String binaryStr = Integer.toBinaryString(num);//二进制
System.out.println(binaryStr);
}
}
再问: 我是想要个用键盘输入数字output二进制的程序,这个好像不是吧?
再答: import java.util.Scanner; public class Du { public static void main(String[] args) { System.out.print("Please input a digit number: "); int num = new Scanner(System.in).nextInt(); String binaryStr = Integer.toBinaryString(num); System.out.println(binaryStr); } }
public static void main(String[] args) {
int num = 15;//十进制
String binaryStr = Integer.toBinaryString(num);//二进制
System.out.println(binaryStr);
}
}
再问: 我是想要个用键盘输入数字output二进制的程序,这个好像不是吧?
再答: import java.util.Scanner; public class Du { public static void main(String[] args) { System.out.print("Please input a digit number: "); int num = new Scanner(System.in).nextInt(); String binaryStr = Integer.toBinaryString(num); System.out.println(binaryStr); } }
write a program that converts a number in base 10 to its equ
1. Write a program to copy its input to its output, replacin
Converts lowercase characters in a buffer to uppercase chara
Write a program that reads a floating-point number and then
Write a C++ program that prompts for a number of rows from t
英语翻译1.write a program that prints its input one word per lin
time a its write speech to 排序
in a bid to help its pupils write their experiences in a
求解jave题,急,write a program that will continu
Write a program that initializes array of 10 elements,Each e
Write a program that generates 4-,10-,or 20-sided dice.
Enter 10numbers from the keyboard,write a program to find th