結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー Amsterdam DAmsterdam D
提出日時 2022-04-15 09:56:59
言語 OCaml
(5.1.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 19,700 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 03:42:12
合計ジャッジ時間 748 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let fb = fun c -> match c with
  | c when c mod 15 = 0 -> "FizzBuzz"
  | c when c mod 5  = 0 -> "Buzz"
  | c when c mod 3  = 0 -> "Fizz"
  | _ -> string_of_int c;;

let rec afb = fun l c -> match l <= c with
  | true  -> Printf.printf "%s" (fb c)
  | false ->
      Printf.printf "%s" (fb c) ;
      Printf.printf "%s" "\n" ;
      afb l (1 + c);;
      
let () = Scanf.scanf "%d" (fun x ->
    afb x 1
    
  )
0