public class Test{
public static void main(String[] args){
String str = "0001";
for(int i = 1; i < 1000; i++){
int temp = Integer.parseInt(str);
temp++;
str = Integer.toString(temp);
for(int t = str.length(); t < 5; t++){
str = "0" + str;
}
System.out.println("the value is " + str);
}
}
}
我已经试过了,你可以根据你的需要进行必要的修改
public static void main(String[] args){
String str = "0001";
for(int i = 1; i < 1000; i++){
int temp = Integer.parseInt(str);
temp++;
str = Integer.toString(temp);
for(int t = str.length(); t < 5; t++){
str = "0" + str;
}
System.out.println("the value is " + str);
}
}
}
我已经试过了,你可以根据你的需要进行必要的修改
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货