题解 | #动态字符串#
动态字符串
http://www.nowcoder.com/practice/e2c51a6f126b41f9be403376c7adea15
import java.util.Scanner;
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String str = scanner.next();
//write your code here......
StringBuilder sb = new StringBuilder(str);
for(int i = sb.length() - 3;i > 0; i = i - 3){
sb.insert(i,",");
}
System.out.print(sb);
}
}