// No.637 X: Yet Another FizzBuzz Problem package main import ( "fmt" "strconv" ) func main() { var a1, a2, a3, a4, a5 int fmt.Scan(&a1, &a2, &a3, &a4, &a5) var a = []int{a1, a2, a3, a4, a5} ans := 0 for i := 0; i < len(a); i++ { if a[i] == 1 { ans += len(strconv.Itoa(a[i])) } else if a[i]%3 == 0 && a[i]%5 == 0 { ans += len("FizzBuzz") } else if a[i]%3 == 0 && a[i]%5 != 0 { ans += len("Fizz") } else if a[i]%3 != 0 && a[i]%5 == 0 { ans += len("Buzz") } else { ans += len(strconv.Itoa(a[i])) } } fmt.Println(ans) }