题解 | #缩短二进制#

缩短二进制

http://www.nowcoder.com/practice/4ffcc9f206b949ddb057ee0099b34d51

import java.util.Scanner;
public class Main {
       public static void main(String[] args)
       {
        System.out.print("0"+Integer.toOctalString(1234)+" ");//8进制
        String sixteen=Integer.toHexString(1234);//16进制
        System.out.println("0X"+sixteen.toUpperCase());//需大写
       }
}

全部评论

相关推荐

重生我想学测开:嵌入式的问题,我准备入行京东外卖了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务