Describe
ACM Team spend C small + often complained: "C language in the format output has 16, 10 or eight output, but there is no binary output, hey, it's a pity!" Who can help me write a program implementation input a decimal number n, output its binary number ah? ”
Don't you want to help her? ^_^
-
- Input
-
- The input has multiple data, the data ends with EOF, and each data ni (0<=ni<=1000010000) is separated by a space;
(Hint: EOF is the end flag for a file; while (scanf ("%d", &n)!=eof) {})
-
- Output
-
- output has multiple lines, each line corresponds to a decimal number of NI binary number;
Note: The output binary removes any extra 0;
-
- Sample input
-
-
0 1 2 10
-
- Sample output
-
01101010
1 ImportJava.math.BigInteger;2 Importjava.util.Arrays;3 ImportJava.util.Scanner;4 5 Public classMain {6 Public Static voidMain (string[] args) {7Scanner scanner=NewScanner (system.in);8 intNumber ;9 String S;Ten One while(Scanner.hasnext ()) { ANumber=scanner.nextint (); -s=long.tobinarystring (number); - System.out.println (s); the } - } -}
Team to spend the trouble of a