输入年份计算生肖年份
#-*-coding:utf-8 -*-
tiangan = {4: "甲", 5: "乙", 6:"丙",7:"丁",8:"戊",9:"己",0:"庚",1:"辛",2:"壬",3:"奎"}
dizhi = {4: "子", 5: "丑", 6:"寅",7:"卯",8:"辰",9:"巳",10:"午",11:"未",0:"申",1:"酉",2:"戌",3:"亥"}
shengxiao = {4: "鼠", 5: "牛", 6:"虎",7:"兔",8:"龙",9:"蛇",10:"马",11:"羊",0:"猴",1:"鸡",2:"狗",3:"猪"}
##for key in tiangan:
## print(str(key)+":"+tiangan[key])
##for key in dizhi:
## print(str(key)+":"+dizhi[key])
if __name__ == '__main__':
year = 1980
##计算10天干获取年份的最后一位
tg_key = str(year)[-1]
tg=tiangan[int(tg_key)]
##计算12地支
dz_key = year % 12
dz = dizhi[dz_key]
sx= shengxiao[dz_key]
print(tg)
print(dz)
print(sx)