LoginSignup
2
1

More than 3 years have passed since last update.

golangで標準入力

Posted at

基本的な標準入力の方法

Go言語で標準入力を行う方法をまとめておきます。

paizaのスキルチェックに標準入力は必須です。

package main

import (
    "bufio"
    "fmt"
    "os"
)

func main(){
    scanner := bufio.NewScanner(os.Stdin)
    for scanner.Scan() {
        ucl := scanner.Text()
        fmt.Println(ucl)
    }   
}
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1