求用C#实现下用0-7可以组成的数是奇数的个数,最高到组成的7位数。我的想法是把0-7放在一个数组里面,然后随机抽取,但是避免不了重复的数,怎么也做不出来,求教!
Your Answer
1 answers
说说我的想法。我觉得既然是奇数,个位一定是奇数,其余的位数用数字随意组合0。如果前几位有0的,忽略就好,比如001就是1,之后再排除类似0001和001等等这种实际上是同一个数的组合,是不是就可以算出来了。
Hot tools Tags
Hot Questions
How can I remove a key from a Python dictionary?
2026-01-02 22:22:08
How to use generics in Unmarshal (go 1.18)
2026-01-02 22:01:13
PHP 5.4 Call-time pass-by-reference - Easy fix available?
2026-01-02 21:43:08
How to create a new object instance from a Type
2026-01-02 21:22:41
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
Douyin level price list 1-75
20416
7
20416
7
wifi shows no ip assigned
13574
4
13574
4
Hot Article
What is the 'basis' of a currency contract? What impact does it have on perpetual contract prices?
2025-12-26
By DDD
How to set up price alerts so you don't miss key entry points?
2026-01-01
By DDD
Tutorial on existence check of nested array values in PHP multidimensional array
2025-12-28
By DDD
How to draw dotted lines in PS How to draw various dotted lines in PS
2025-12-28
By DDD






