Added a tiny mclibre exercise

Exercise about arithmetic
This commit is contained in:
raul 2024-01-25 12:07:20 +00:00
parent 114ba0c417
commit 09ecc6a483
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
package main
import (
"bufio"
"fmt"
"os"
//"strconv"
)
func main() {
fmt.Println("CÁLCULO DE LA MEDIA DE DOS NÚMEROS")
reader := bufio.NewReader(os.Stdin)
fmt.Print("Escriba un número: ")
num1String, _ := reader.ReadString('\n')
fmt.Print("Escriba otro número: ")
num2String, _ := reader.ReadString('\n')
// num1, err := strconv.Atoi(num1String)
// if err != nil {
// panic(err)
// }
// num2, err := strconv.Atoi(num2String)
// if err != nil {
// panic(err)
// }
fmt.Printf("%v y %v", num1String, num2String)
// fmt.Printf("Has escrito %v y %v\n", num1String, num2String)
// This is so incredibly convoluted I'm having a stroke
// TODO: make this less painful to look at
}