回答編集履歴

1

修正

2023/02/02 04:47

投稿

jimbe
jimbe

スコア12646

test CHANGED
@@ -3,7 +3,7 @@
3
3
  public class Main {
4
4
  public static void main(String[] args) throws Exception {
5
5
  String[] a = { "3276207", "2865329", "1291117", "1096829", "978100", "322723"};
6
- for(String s : a) System.out.println(s.replaceAll("(?<=\\d)(\\d{3})(?=(\\d{3})*$)", ",$1"));
6
+ for(String s : a) System.out.println(s.replaceAll("(?<=\\d)(?=(\\d{3})+$)", ","));
7
7
  }
8
8
  }
9
9
  ```