中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-11-10 22:16
47,815 topics / 349,930 posts / today 0 new / 48,291 members
DOS批处理 & 脚本技术(批处理室) » [Help] How to find out which numbers in the text add up to a specified value
Printable Version  4,941 / 48
Floor46 qjbm Posted 2007-03-05 06:10
初级用户 Posts 44 Credits 125
Originally posted by youxi01 at 2007-3-3 06:48 PM:
The code is as follows, welcome to test and correct.
Floor47 Climbing Posted 2007-03-05 06:36
铂金会员 Posts 2,753 Credits 6,964 From 河北保定
It's relatively difficult to implement with high-level languages, let alone batch processing, as the efficiency is too low.
Floor48 electronixtar Posted 2007-03-11 07:42
铂金会员 Posts 2,672 Credits 7,493
So, the actual numbers of digits are in cases like 35, 36, 37, 38, etc.

Sort and then filter combinations where the sum of the units digit and the tens digit is 80 (because the result requires 171780). After filtering, then find the combinations.
Floor49 qjbm Posted 2007-03-16 04:57
初级用户 Posts 44 Credits 125
Originally posted by electronixtar at 2007-3-10 06:42 PM:

Sort, then filter combinations where the sum of the units digit and tens digit is 80 (since the result requires 171780). After filtering, then find the combinations.



Before referring to qzwqzw's code, such an idea had already been tried.
The code was only halfway written when it was discovered that when writing the filter for , it was purely a detour.

Because filtering also requires enumerating permutations and combinations..... Hehe....

Why not just give the result directly? If that's the case, what's the use of sorting... Hehe.....
Prev  1 2 3 4
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023