public class Main{
public static void main(String args[]){
final char HexTable[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
String str="电脑圈圈的USB专区
Http://group.ednchina.com/93/";
char c;
for(int i=0;i<str.length();i++){
c=str.charAt(i);
System.out.print("0x");
for(int j=0;j<2;j++)
System.out.print(HexTable[(((int)c)>>((1-j)*4))&0x0F]);
System.out.print(",0x");
for(int j=0;j<2;j++)
System.out.print(HexTable[(((int)c)>>((3-j)*4))&0x0F]);
System.out.println(",");
}
}
}
文章评论(0条评论)
登录后参与讨论