生成我们自己的数字索引 [英] Generate our own index of number

查看:60
本文介绍了生成我们自己的数字索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建仅包含0、2、7的数字索引,而忽略所有其他数字?

前任. 0,2,7,20,22,27,70,72,77,200,202,207,...

How can I create index of number that contain only 0,2,7 in it and ignore all of the other numbers?

Ex. 0,2,7,20,22,27,70,72,77,200,202,207,...

推荐答案

您可以编写一个简单的递归函数来检查char右移,然后使用 select 开关进行递增. (忘记了它是C#而不是vb)

然后,如果它是7,则将其设为0,然后将char递增到该char的左侧.
You could write a simple recursive function that checks the char to the right and then use a select switch to increment. (forgot it was c# not vb)

Then, if it''s a 7, make it a zero and increment the char to the left of that char.


这篇关于生成我们自己的数字索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆