package main import ( "bufio" "io" "os" "strconv" ) func main() { foo1() /* reader := bufio.NewReader(os.Stdin) var sum int for { line, _, err := reader.ReadLine() if err == io.EOF || len(line) == 0 { break } num, _ := strconv.Atoi(string(line)) sum += num } io.WriteString(os.Stdout, strconv.Itoa(sum)) */ } func foo1() { scanner := bufio.NewScanner(os.Stdin) sum := 0 for scanner.Scan() { a, _ := strconv.Atoi(scanner.Text()) sum += a } io.WriteString(os.Stdout, strconv.Itoa(sum)) }