生成字母数字唯一编号
我想生成字母数字唯一数字,但格式应该是这样的
,应该从 AA001 到 AA999 开始,然后 AB001 到 AB999 .... BA001 到 BA999 以 ZZ999 结尾。如果我提供意见,
1 = result AA001
999 = result AA999
1000 = result AB001
有人可以帮忙吗?
I want to generate alphanumeric unique numbers but the format should be like this
that should be starts from AA001 to AA999 after that AB001 to AB999 .... BA001 to BA999 end with ZZ999. if i give the input is
1 = result AA001
999 = result AA999
1000 = result AB001
any one can help this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
完整的解决方案(查看其运行):
注意:您需要确保输入的数字在有效范围内(包含 000 数字时为 0...675999,否则为 1...675324)
注意:答案已修改,之前错过了要点那个 000 不是允许
Complete solution (see it running):
Note: you need to make sure that the input number is within the valid range (0...675999 when including 000-numbers, 1...675324 otherwise)
Note: answer revised, missed the point earlier that 000 is not allowed
怎么样:
输出:
How about:
output: