# --*-- coding: utf-8 --*--# create by xiaocaiji while 1: str_ip = input("input a IP:") list_ip = str_ip.split('.') if len(list_ip) < 4: print("error IP") for i in list_ip: if int(i) > 256: print("error IP") elif int(i)
把字符串数组转换为16进制字符串 import java.security.MessageDigest; public class StringUtil { public StringUtil() { super(); } public static String str; public static final String EMPTY_STRING = ""; private final static String[] hexDigits = { "0", &q