結果

問題 No.784 「,(カンマ)」
ユーザー xsd
提出日時 2020-06-14 17:27:13
言語 OCaml
(5.2.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 21,516 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 01:08:16
合計ジャッジ時間 1,047 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%d" (fun n ->
    let rec loop r acc =
        if r < 1000 then Printf.sprintf "%d%s" r acc else
            loop (r / 1000) (Printf.sprintf ",%03d%s" (r mod 1000) acc)
    in
    loop n "" |> print_endline
)
0