Created
May 16, 2013 15:46
-
-
Save eienf/5592709 to your computer and use it in GitHub Desktop.
convert Input : decimal number to the specific radix number string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Convert { | |
public static void main(String args[]) { | |
if ( args.length < 2 ) { | |
throw new IllegalArgumentException("parameter : decimal radix"); | |
} | |
int decimal = Integer.parseInt(args[0]); | |
int radix = Integer.parseInt(args[1]); | |
String s = Integer.toString(decimal,radix); | |
System.out.println("result = "+s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment