Closed1

F#でAtCoderをやるときの標準入力のスニペット集

四ツ山伊吹四ツ山伊吹
module Basis =
    let read: unit -> string = stdin.ReadLine
    let input: string = read ()

module Integer =
    open Basis
    let readInteger: unit -> int = read >> int
    let integer: int = readInteger ()

module MultipleColumns =
    open Basis

    let readStringArray: unit -> string array =
        let split (s: string) = s.Split()
        read >> split
    let strings: string array = readStringArray ()

    let readIntegerArray: unit -> int array = readStringArray >> Array.map int
    let integers: int array = readIntegerArray ()

module FixedColumns =
    open MultipleColumns

    let substrings = readStringArray ()
    let a, b = (substrings.[0], substrings.[1])
    //let [| e0; e1 |] = substrings[0..1]

    let sequence = readIntegerArray ()
    let l, m, n = (sequence.[0], sequence.[1], sequence.[2])
    //let [| x0; x1; x2 |] = sequence[0..2]
このスクラップは2022/05/08にクローズされました