public class Main { public static void main(String[] args) { for (char c = 'A'; c <= 'Z'; c += 1) { for (int i = 1; i <= 999; i++) { System.out.print(c); System.out.printf("%03d", i); System.out.println(""); } } } }
class IdClass { private static char first = 'A'; private static int id = 0; public synchronized String getId() { if(++id > 999) { id = 0; first += 1; }
public class Main { public static void main(String[] args) {
for (char c = 'A'; c <= 'Z'; c += 1) {
for (int i = 1; i <= 999; i++) {
System.out.print(c);
System.out.printf("%03d", i);
System.out.println("");
}
}
}
}
public static void main(String[] args) {
for(char c='A';c<='Z';c++) {
for(int i=1;i<=999;i++) {
String str = String.valueOf(c);
str += ("000"+i).substring(String.valueOf(i).length());
System.out.println(str);
}
}
}
这个代码是可以给出LZ的结果
但是这绝不是LZ想要的,要的是编码自动顺序生成,最新一个是A098则下一个是A099
A999-B001
B999-C001这个也很简单吧
{
System.out.println(c+"000----"+c+"999")
}
class IdClass {
private static char first = 'A';
private static int id = 0;
public synchronized String getId() {
if(++id > 999) { id = 0; first += 1; }
if(first > 'Z') first = 'A';
return String.format("%s%03d", first,id);
}
}