Untitled

mail@pastecode.io avatar
unknown
golang
3 years ago
560 B
1
Indexable
Never
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	var inputValues = []string{}

	for scanner.Scan() {

		line := scanner.Text()

		if len(line) == 0 {
			break
		}
		inputValues = append(inputValues, line)
		fmt.Println(line, " was added to inputValues")
	}

	fmt.Println("complete array of inputValues: ", inputValues)

	fmt.Println(inputValues[0])
	fmt.Println(inputValues[1])
	fmt.Println(inputValues[2])

	primuInputCaNr, _ := strconv.Atoi(inputValues[0])
	fmt.Println(primuInputCaNr + 3)

}