CPyUG Wiki Logo

ChinesePython/tasting

Login
  • 首页
  • CPUG
  • OpenBookProject
  • 更新
  • 搜索
  • 帮助
  • ChinesePython/tasting

  • Immutable Page
  • Comments
  • Info
  • Attachments

Revision 1 as of 2005-11-20 07:18:15

Clear message
  • 直观的组合出一甲子的年份

       1 #--GBK--
       2 天干=("甲","乙","丙","丁","戊","己","庚","辛","壬","葵")
       3 地支=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
       4 公元 = 2000
       5 天干地支 = ""
       6 取 干 自 天干:
       7     取 支 自 地支:
       8         写 干+支
       9         天干地支 += 干+支+"  "+变字串(公元) 
      10         公元+=1
      11 打开('天干地支.txt', 'w').输出(天干地支)        
    
  • Immutable Page
  • Comments
  • Info
  • Attachments
  • 豆瓣友情赞助