怎么把这个程序的结果分三行输出?

summit128 2005-03-01 10:32:58
class HexRead{
String[] input={"000A110D1D260219",
"78700F1318141E0C",
"6A197D45B0FFFFFF"
};

public static void main(String[] arg){
HexRead hex=new HexRead();
for(int i=0;i<hex.input.length;i++)
hex.readLine(hex.input[i]);
}

void readLine(String code){
try{
for(int j=0;j+1<code.length();j+=2){
String sub=code.substring(j,j+2);
int num=Integer.parseInt(sub,16);
if(num==255)
return;
System.out.println(num);
}
}finally{
System.out.println("**");
}
return;
}
}
...全文
132 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fish2mini 2005-03-01
  • 打赏
  • 举报
回复
for(int j=0;j+1<code.length();j+=2)
{
String sub=code.substring(j,j+2);
int num=Integer.parseInt(sub,16);
if(num==255);
return;
System.out.print(num);// println--->print
}
//add this code
System.out.println();

xitianjile 2005-03-01
  • 打赏
  • 举报
回复
没整明白什么意思。

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧