結果

問題 No.784 「,(カンマ)」
ユーザー maimai8
提出日時 2019-06-10 20:00:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-06 00:45:51
合計ジャッジ時間 1,187 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

def printNum (lst, i):
    for x in range(1, len(lst)+1):
        if (x-1) % 3 == i and (x-1) != 0:
            print(",{}".format(lst[x-1]), end="")
        else:
            print(lst[x-1], end="")
    print("")
if __name__ == '__main__':
    n = list(input())
    l = len(n)
    if l <= 3:
        printNum(n, 0)
    else:
        printNum(n, l % 3)
0