源代码
a = ["十" ,"一", "二", "三", "四", "五", "六", "七", "八", "九"] for i in range(1, 10): for j in range(1, i+1): print(a[j], end="") print(a[i], end="") if i * j < 10: print("得", end="") print(a[i*j], end=" ") else: t1 = i * j // 10 t2 = i * j % 10 if t1 == 1 and t2 == 0: print("一十", end=" ") else: if t1 > 1: print(a[t1], end="") print("十", end="") print(a[t2], end="") if t1 == 1: print(" ", end="") if t2 == 0: print(" ", end="") if i == j: print("") else: print("", end="\t")
运行结果
原文:https://www.cnblogs.com/Chaosliang/p/11595030.html