fork download
  1.  
Success #stdin #stdout 0.09s 14104KB
stdin
import random

def generate_dlt_30_10():
    # 前区范围 01-35
    front_pool = list(range(1, 36))
    # 后区范围 01-12
    back_pool = list(range(1, 13))

    # 随机抽取
    front_selected = sorted(random.sample(front_pool, 30))  # 前区选30个
    back_selected = sorted(random.sample(back_pool, 10))    # 后区选10个

    # 未选中的号码
    front_missing = sorted(list(set(front_pool) - set(front_selected)))
    back_missing = sorted(list(set(back_pool) - set(back_selected)))

    # 格式化输出为两位数
    def fmt_nums(nums):
        return [f"{n:02d}" for n in nums]

    print("=== 大乐透 30+10 随机复式 ===")
    print("前区 30 个号码:", " ".join(fmt_nums(front_selected)))
    print("前区未出现号码:", " ".join(fmt_nums(front_missing)))
    print("后区 10 个号码:", " ".join(fmt_nums(back_selected)))
    print("后区未出现号码:", " ".join(fmt_nums(back_missing)))
    print("\n注数计算:")
    import math
    c_front = math.comb(30, 5)
    c_back = math.comb(10, 2)
    total_combinations = c_front * c_back
    print(f"前区组合数 C(30,5) = {c_front}")
    print(f"后区组合数 C(10,2) = {c_back}")
    print(f"总注数 = {total_combinations:,} 注")
    print(f"投注金额 = {total_combinations * 2:,} 元")

# 运行函数
if __name__ == "__main__":
    generate_dlt_30_10()
stdout
Standard output is empty