for(int i = 1i<张数i++) {
int numlength = ((Integer)i).toString().length()
//上边誉芹灶明的庆辩毕数就能确定前边0的个数,然后拼接字符串
}
import java.util.LinkedListpublic class ReplaceNumber
{
public static void main ( String[] args )
{
LinkedList<String> result = new LinkedList<String> ()
char r = '0', g = '0', b = '0'
String rgb = "" + r + g + b
while (!"ZZZ".equals (rgb))
{
if (b < ':' || ( b >= '肆扰A' - 1 && b <= 'Z' ))
{
b++
}
if (':' == b || 'Z' + 1 == b)
{
if (g < ':')
{
g++
b = '9'
}
if (g < 'Z' + 1 && g > ':')
{
g++
b = 'Z'
}
}
if (':' == g || 'Z' + 1 == g)
{
if (r < '9')
{
r++
g = '9'
}
if (r < 'Z' + 1 && r > ':')
{
r++
g = 'Z'
}
}
rgb = "" + r + g + b
if ("祥雹族999".equals (rgb))
{
r = 'A'
g 谨弊= '0'
b = '0'
}
if ("A99".equals (rgb))
{
r = 'A'
g = 'A'
b = '0'
}
if ("AA9".equals (rgb))
{
r = 'A'
g = 'A'
b = 'A' - 1
}
result.add (rgb)
}
System.out.println ("唯一序列号:\n" + result.toString ().replaceAll ("[\\[\\]]", "").replaceAll ("\\, ", "\n"))
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)