結果

問題 No.784 「,(カンマ)」
ユーザー chike_pluschike_plus
提出日時 2019-03-08 09:30:02
言語 F#
(F# 4.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 3,429 ms
コンパイル使用メモリ 162,604 KB
実行使用メモリ 26,760 KB
最終ジャッジ日時 2023-09-05 19:33:30
合計ジャッジ時間 5,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
22,684 KB
testcase_01 AC 81 ms
24,732 KB
testcase_02 AC 76 ms
22,628 KB
testcase_03 AC 79 ms
22,704 KB
testcase_04 AC 78 ms
22,680 KB
testcase_05 AC 78 ms
20,640 KB
testcase_06 AC 78 ms
22,624 KB
testcase_07 AC 78 ms
20,584 KB
testcase_08 AC 78 ms
24,672 KB
testcase_09 AC 78 ms
22,852 KB
testcase_10 AC 79 ms
26,760 KB
testcase_11 AC 78 ms
22,772 KB
testcase_12 AC 78 ms
22,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
open System.Text

let addCommma (args:StringBuilder) =
  let amari = args.Length % 3
  for i in [args.Length-1..-1..0] do
    if i <> 0 && i % 3 = amari
    then args.Insert( i , ',' ) |> ignore
    
  args.ToString()    
  
Console.ReadLine()
|> StringBuilder
|> addCommma
|> printfn "%s"
0