由网友(别笑我懦弱)分享简介:如何列出所有可能的字母组合(从字母:qwertyuiopasdfghjklzxcvbnm),如:①W¯¯ËřŤÿüØp小号ðFGHĴķ升xCvbñ米QQQWQEQRQT曲多达64位的长字符串?所以最后一个将是串(8)MMMMMMMM解决方案 的($ A = 97...![Excel中如何计算文本字符串的长度](https://p.xsw88.cn/allimgs/daicuo/20230911/3289.png)
如何列出所有可能的字母组合(从字母:qwertyuiopasdfghjklzxcvbnm),如:
①
W¯¯
Ë
ř
Ť
ÿ
ü
Ø
p
小号
ð
F
G
H
Ĵ
ķ
升
x
C
v
b
ñ
米
QQ
QW
QE
QR
QT
曲
多达64位的长字符串?所以最后一个将是串(8)
MMMMMMMM
解决方案
的($ A = 97; $ A< 123; $ A ++){
为($ B = 97; $ b将123; $ A ++){
为($ C = 97; $ C< 123; $ B ++){
为($ D = 97; $ D< 123; $ A ++){
为($ E = 97; $ E< 123; $ A ++){
为($ F = 97; $ F< 123; $ A ++){
为($ G = 97; $ G< 123; $ C ++){
为($ H = 97; $ H< 123; $ D ++){
回声CHR($ A).CHR($ B).CHR($ C).CHR($ D).CHR($ E).CHR($ F).CHR($ G).CHR($ H);
}}}}}}}}
![Excel中如何计算文本字符串的长度](https://p.xsw88.cn/allimgs/daicuo/20230911/3289.png)
没有尝试过,但。它直线前进的。短期code使用递归或类似的东西。顺便说一句这只能显示8字符长的数字,所以对于短的,你需要更多的code,但这个想法是差不多的。
How to list all possible letter combinations (from an alphabet: "qwertyuiopasdfghjklzxcvbnm"), like:
q
w
e
r
t
y
u
o
p
s
d
f
g
h
j
k
l
x
c
v
b
n
m
qq
qw
qe
qr
qt
qu
up to 64 bit long strings? So the last one would be String(8):
mmmmmmmm
解决方案
for($a=97; $a<123; $a++){
for($b=97; $b<123; $a++){
for($c=97; $c<123; $b++){
for($d=97; $d<123; $a++){
for($e=97; $e<123; $a++){
for($f=97; $f<123; $a++){
for($g=97; $g<123; $c++){
for($h=97; $h<123; $d++){
echo chr($a).chr($b).chr($c).chr($d).chr($e).chr($f).chr($g).chr($h);
}}}}}}}}
Haven't tried though. Its straight forward one. for short code use recursion or something like that. by the way this only shows 8 char long numbers so for shorter ones you need more code, but the idea is about the same.
相关推荐
最新文章