結果

問題 No.784 「,(カンマ)」
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-12 17:46:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 71,924 KB
実行使用メモリ 57,960 KB
最終ジャッジ日時 2023-10-11 10:56:24
合計ジャッジ時間 4,474 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,324 KB
testcase_01 AC 117 ms
55,900 KB
testcase_02 AC 118 ms
55,436 KB
testcase_03 AC 117 ms
55,476 KB
testcase_04 AC 116 ms
55,872 KB
testcase_05 AC 117 ms
57,960 KB
testcase_06 AC 117 ms
55,748 KB
testcase_07 AC 119 ms
55,996 KB
testcase_08 AC 121 ms
55,940 KB
testcase_09 AC 120 ms
56,060 KB
testcase_10 AC 119 ms
55,904 KB
testcase_11 AC 119 ms
55,896 KB
testcase_12 AC 119 ms
55,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {

		StringBuilder sb = new StringBuilder(sc.next());
		int length = sb.length();
		for (int i=length-1; i>=1; i--) {
				if ((length-i)%3==0) sb.insert(i,",");
		}
		
		System.out.println(sb);
		
	}
}
0