public class HelloWorld29 {
public static void main(String[] args) {
// TODO Auto-generated method stub
StringBuilder str=new StringBuilder();
str.append("jaewkjldfxmopzxas");
int x=(str.length()/3)+str.length();
for(int i=3;i<x;i+=4)
str.insert(i,",");
System.out.print(str.toString());
}
}
for(int i=3;i<str.length();i=i+4){
str.insert(i,",");
}
我直接看了笔记,赞最多的那个了--
public static void main(String[] args) {
// TODO Auto-generated method stub
StringBuilder str=new StringBuilder();
str.append("jaewkjldfxmopzxas");
for(int i=3;i<str.length();i+3){
str.insert(i,",");
}
System.out.print(str.toString());
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
StringBuilder str=new StringBuilder();
str.append("jaewkjldfxmopzxas");
for(int i=str.length()-3;i>0;i-3){
str.insert(i,",");
}
System.out.print(str.toString());
}
}