結果

問題 No.784 「,(カンマ)」
ユーザー rabirabi
提出日時 2019-08-15 15:01:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 2,276 ms
コンパイル使用メモリ 74,868 KB
実行使用メモリ 53,512 KB
最終ジャッジ日時 2023-10-19 19:03:27
合計ジャッジ時間 3,815 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
52,428 KB
testcase_01 AC 58 ms
52,464 KB
testcase_02 AC 57 ms
53,512 KB
testcase_03 AC 56 ms
53,500 KB
testcase_04 AC 57 ms
53,492 KB
testcase_05 AC 54 ms
53,500 KB
testcase_06 AC 58 ms
52,416 KB
testcase_07 AC 55 ms
52,428 KB
testcase_08 AC 54 ms
53,496 KB
testcase_09 AC 58 ms
52,472 KB
testcase_10 AC 56 ms
53,500 KB
testcase_11 AC 56 ms
53,508 KB
testcase_12 AC 61 ms
53,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class test {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder(br.readLine());
        int l = sb.length();
        for(int i=l-1; i>=1; i--){
            if ((l-i)%3==0) sb.insert(i,",");
        }
        System.out.println(sb);
    }
}
0