从前M个字母中任取N个的组合 [2*+]

目录

从前M个字母中任取N个的组合 [2*+] 

程序设计 

程序分析 


从前M个字母中任取N个的组合 [2*+] 

输出前M个字母中任取N个的所有组合情况

Input

输入两个数M 和 N
M>=N
1<=M<=10

Output

按字典序输出组合情况

Sample Input

4 2

Sample Output

AB
AC
AD
BC
BD
CD

程序设计 

Python

def dfs(s,n,t,start):
    if len(s)==t:
        print(s)
        return
    for i in range(start,n):
   

猜你喜欢

转载自blog.csdn.net/m0_68111267/article/details/130033239