반응형
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cnt = sc.nextInt();
String n = sc.next();
String rs = "";
int j = 0;
for(int i = n.length() - 1; i >= 0; i--) {
if(j % 3 == 0 && j != 0) {
rs = "," + rs;
}
rs = n.charAt(i) + rs;
j++;
}
System.out.println(rs);
}
}
반응형
'프로그래밍 > 코드업 일기' 카테고리의 다른 글
코드업(CodeUp) 4726 : 수열 (0) | 2023.08.11 |
---|---|
코드업(CodeUp) 4721 : 투표 (0) | 2023.08.11 |
코드업(Codeup) 3015 : 성적표 출력 (실패) (0) | 2023.08.10 |
코드업(Codeup) 4691 : 주사위 네 개 (0) | 2023.08.10 |
코드업(Codeup) 4566 : 소수 (0) | 2023.08.10 |