安卓slg吧 关注:41贴子:93
  • 2回复贴,共1
/*输出十六进制数的十进制*/
public class Print
{
public static void main(String[] args)
{
//170
System.out.println(0xAA);
//再输出一个数的十六进制表现形式
int x = 60;
int temp1 = x/16;
if (temp1 > 9)
{
char ch1 = (char)(temp1 - 10 + 'A' );
System.out.println(ch1);
}
else
{
}
int y = x%16;
System.out.println(y);
}
}


IP属地:重庆来自Android客户端1楼2014-05-25 13:01回复
    /*输出十六进制数的十进制*/
    public class Print
    {
    public static void main(String[] args)
    {
    //170
    System.out.println(0xAA);
    //再输出一个数的十六进制表现形式
    int x = 60;
    int temp1 = x/16;
    if (temp1 > 9)
    {
    char ch1 = (char)(temp1 - 10 + 'A' );
    System.out.println(ch1);
    }
    else
    {
    }
    int y = x%16;
    System.out.println(y);
    }
    }


    IP属地:重庆来自Android客户端2楼2014-05-25 13:02
    回复
      贴吧好垃圾,乱显示,间距都没了


      IP属地:重庆来自Android客户端3楼2014-05-25 13:03
      回复