add: unfinished code. people are having problems

This commit is contained in:
Inanc Gumus
2018-11-13 17:43:25 +03:00
parent 67b20e5755
commit 490223331c
103 changed files with 4218 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
args := os.Args[1:]
var (
sum float64
nums []float64
)
for _, v := range args {
n, err := strconv.ParseFloat(v, 64)
if err != nil {
continue
}
nums = append(nums, n)
sum += n
}
fmt.Println("Your numbers:", nums)
fmt.Println("Average:", sum/float64(len(nums)))
}