#-*-coding:utf-8 -*-import retianGan=["癸","甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]diZhi=["亥","子","丑","寅","卯","辰","巳","午","未","申","酉","戌"]shuXiang=["猪","鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗"]Year=int(re.match("[0-9]{4}",input("请输入日期:")).group()) #检索年份,进行计算TG=(Year-3)%10 #获取天干的索引DZ=(Year-3)%12 #获取地支的索引print("%s%s年/%s年"%(tianGan[TG],diZhi[DZ],shuXiang[DZ]))