Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 14 KBi |
#2 |
Correcto
|
0.005 s | 8 KBi |
#3 |
Correcto
|
0.006 s | 5 KBi |
#4 |
Correcto
|
0.008 s | 53 KBi |
#5 |
Correcto
|
0.005 s | 11 KBi |
package main import ( "bufio" "fmt" "os" "strconv" "strings" ) func main() { reader := bufio.NewReader(os.Stdin) data, _ := reader.ReadString('\n') data = strings.ReplaceAll(data, "\n", "") numbers := strings.Split(data, " ") var result int64 = 0 for _, numS := range numbers { num, _ := strconv.ParseInt(numS, 10, 64) result += num } fmt.Println(result) }