package mainimport("fmt""time")funcgetZodiac(month int, day int)string{switch{case month ==12&& day >=22:return"摩羯座"case month ==1&& day <=19:return"摩羯座"case month ==1&& day >=20:return"水瓶座"case month ==2&& day <=18:return"水瓶座"case month ==2&& day >=19:return"双鱼座"case month ==3&& day <=20:return"双鱼座"case month ==3&& day >=21:return"白羊座"case month ==4&& day <=19:return"白羊座"case month ==4&& day >=20:return"金牛座"case month ==5&& day <=20:return"金牛座"case month ==5&& day >=21:return"双子座"case month ==6&& day <=20:return"双子座"case month ==6&& day >=21:return"巨蟹座"case month ==7&& day <=22:return"巨蟹座"case month ==7&& day >=23:return"狮子座"case month ==8&& day <=22:return"狮子座"case month ==8&& day >=23:return"处女座"case month ==9&& day <=22:return"处女座"case month ==9&& day >=23:return"天秤座"case month ==10&& day <=22:return"天秤座"case month ==10&& day >=23:return"天蝎座"case month ==11&& day <=21:return"天蝎座"case month ==11&& day >=22:return"射手座"case month ==12&& day <=21:return"射手座"default:return"未知星座"}}funcmain(){var timestamp int64fmt.Println("请输入您的出生时间戳(秒级): ")fmt.Scanln(×tamp)// 将时间戳转换为 time.Time 对象t := time.Unix(timestamp,0)// 获取月份和日期month :=int(t.Month())day := t.Day()// 确定星座zodiac :=getZodiac(month, day)fmt.Printf("您的星座是: %s\n", zodiac)}