io

package
v0.0.0-...-950d956 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2025 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitIo

func InitIo(props *InitIoProps) (*In, *Out)

InitIo は inとoutを初期化します。

Types

type In

type In struct {
	// NextString は 次の入力を文字列として読み込んで返します。
	NextString func() string
}

================================================== 入出力操作 ==================================================

func (*In) NextBytes

func (in *In) NextBytes() []byte

NextBytes は 次の入力をbyteの配列として読み込んで返します。 遅いから極力使わない。

func (*In) NextBytesOffset

func (in *In) NextBytesOffset(offset byte) []int

NextBytesOffsetは、次の入力を文字列として読み込み、各文字cについて(c-offset)に置き換えた配列を返します。

func (*In) NextFloat

func (in *In) NextFloat() float64

NextFloat は 次の入力を実数値として読み込み、値を返します。

func (*In) NextInt

func (in *In) NextInt() int

NextInt は 次の入力を数値として読み込んで返します。

func (*In) NextInt2

func (in *In) NextInt2() (int, int)

NextInt2 は 次の2つの入力を数値として読み込んで返します。

func (*In) NextInt2d

func (in *In) NextInt2d(d1, d2 int) (int, int)

NextInt2d は 次の2つの入力を数値n1,n2として読み込んで、n1+d1, n2+d2を返します。

func (*In) NextInt3

func (in *In) NextInt3() (int, int, int)

NextInt3 は 次の3つの入力を数値として読み込んで返します。

func (*In) NextInt3d

func (in *In) NextInt3d(d1, d2, d3 int) (int, int, int)

NextInt2d は 次の3つの入力を数値n1,n2,n3として読み込んで、n1+d1, n2+d2, n3+d3を返します。

func (*In) NextInt4

func (in *In) NextInt4() (int, int, int, int)

NextInt4 は 次の4つの入力を数値として読み込んで返します。

func (*In) NextInts

func (in *In) NextInts(n int) sort.IntSlice

NextInts は 次のn個の入力を数値として読み込んで、配列として返します。

func (*In) NextLongIntAsArray

func (in *In) NextLongIntAsArray() []int

NextLongIntAsArray は 次の入力を数値として読み込み、各桁を要素とした配列を返します。

type InitIoProps

type InitIoProps struct {
	// バッファを行うかどうか。
	DoBuffer bool

	// 行単位で読むか、改行単位で読むか。
	ReadLine bool
}

type Out

type Out struct {
	Flush func()
	// contains filtered or unexported fields
}

func (*Out) PrintIntsLn

func (out *Out) PrintIntsLn(a []int)

PrintIntsLn は整数配列の各要素をスペース区切りで出力し、最後に改行を出力します。

func (*Out) PrintLenAndIntsLn

func (out *Out) PrintLenAndIntsLn(a []int)

func (*Out) PrintStringsln

func (out *Out) PrintStringsln(a []string)

PrintStringsln は文字列配列の各要素をスペース区切りで出力し、最後に改行を出力します。

func (*Out) Printf

func (out *Out) Printf(format string, a ...interface{})

Printf はformatにしたがってaを整形して出力します。

func (*Out) Println

func (out *Out) Println(a ...interface{})

Println は引数をスペース区切りで出力し、最後に改行を出力します。

func (*Out) Putc

func (out *Out) Putc(c byte)

Putcは一文字出力します。

func (*Out) YESNO

func (out *Out) YESNO(cond bool)

func (*Out) YesNo

func (out *Out) YesNo(cond bool)

YesNo は condが真ならYes, 偽ならNoを出力します。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL