█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 4688

Problema 0x78 - Suma de 2 números

  • Autor: cams2692
  • Fecha: 2021-08-09 02:38:53 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 127
run: line 1: ./main: No such file or directory
0.003 s 37 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 127
run: line 1: ./main: No such file or directory
0.002 s 17 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 127
run: line 1: ./main: No such file or directory
0.002 s 14 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 127
run: line 1: ./main: No such file or directory
0.003 s 21 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 127
run: line 1: ./main: No such file or directory
0.004 s 23 KBi
Puntos totales: 0 / 100

Código

package codeoapp

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

func main() {
	reader := bufio.NewReader(os.Stdin)

	data, _ := reader.ReadString('\n')
	numbers := strings.Split(data, " ")
	var result int64 = 0
	for _, numS := range numbers {
		num, _ := strconv.ParseInt(numS, 10, 64)
		result += num
	}
	fmt.Println(result)
}