嗨,我昨天问过这个问题,但由于不被理解而被关闭,所以这次我会尽量说得更具体一些。所以这里的情况。
1.我在一个字符数组中有 3 个字符:A、B、C,如下所示:
char[] characters = {'A', 'B', 'C'};
2.在枚举这 3 个字符的所有可能匹配项时,我得到例如以下内容:
Text = A
tries = 1
indexes = characters[0]
------------
Text = B
tries = 2
indexes = characters[1]
------------
Text = C
tries = 3
indexes = characters[2]
------------
Text = AA
tries = 4
indexes = characters[0] characters[0]
------------
Text = AB
tries = 5
indexes = characters[0] characters[1]
------------
Text = AC
tries = 6
indexes = characters[0] characters[2]
------------
Text = BA
tries = 7
indexes = characters[1] characters[0]
------------
Text = BB
tries = 8
indexes = characters[1] characters[1]
------------
Text = BC
tries = 9
indexes = characters[1] characters[2]
------------
Text = CA
tries = 10
indexes = characters[2] characters[0]
------------
Text = CB
tries = 11
indexes = characters[2] characters[1]
------------
Text = CC
tries = 12
indexes = characters[2] characters[2]
3.现在给定某个try的次数,我们能得到这个特定try的索引数吗?例如,在此尝试的尝试编号 10 处,文本是 CA(如上所示),因为索引是字符 [2] 和字符 [0],所以是否有一个数学方程可以知道这些索引编号具有尝试次数?
谢谢