Submission #308183


Source Code Expand

open Format
open Scanf

let input = scanf "%d" (fun x -> x)
let itos = string_of_int

let r =
  match input with
  | _ when input < 100 -> "00"
  | _ when 100 <= input && input < 1000 ->
    let x = input / 100 in
    "0" ^ (itos x)
  | _ when 1000 <= input && input < 5000 ->
    let x = input / 100 in
    itos x
  | _ when 6000 <= input && input < 30000 ->
    let x = input / 1000 in
    itos (x + 50)
  | _ when 35000 <= input && input < 70000 ->
    let x = input / 1000 in
    (x - 30) / 5 + 80
    |> itos
  | _ -> "89"

let _ = print_endline r

Submission Info

Submission Time
Task B - 視程の通報
User no_maddo
Language OCaml (3.12.1)
Score 0
Code Size 578 Byte
Status CE

Compile Error

File "./Main.ml", line 22, characters 4-6:
Error: Unbound value |>