// No.188 HAPPY DAY package main import ( "fmt" "strconv" "time" ) func main() { start := time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC) var ans int = 0 for i := 0; i < 365; i++ { _, m, d := start.AddDate(0, 0, i).Date() d1, _ := strconv.Atoi(string(fmt.Sprintf("%02d", d)[0])) d2, _ := strconv.Atoi(string(fmt.Sprintf("%02d", d)[1])) if int(m) == (d1 + d2) { ans++ } } fmt.Println(ans) }