Given a plain numeric text file, one record per line, with no blank lines, find the sums of all different combinations of this column of numbers (combinations with the same line numbers but different value order are treated as the same combination). The required output format is n1+n2+n3=sum.
For example, if the text content is:
Then the required output format is (the order may be shuffled):
1+2+3=6 and 2+1+3=6 are treated as the same combination.
[ Last edited by namejm on 2006-12-29 at 09:55 PM ]
For example, if the text content is:
1
2
3
4
5
Then the required output format is (the order may be shuffled):
1+2=3
1+3=4
1+4=5
1+5=6
2+3=5
2+4=6
2+5=7
3+4=7
3+5=8
4+5=9
1+2+3=6
1+2+4=7
1+2+5=8
1+3+4=8
1+3+5=9
1+4+5=10
2+3+4=9
2+3+5=11
3+4+5=12
1+2+3+4=10
1+2+3+5=11
1+3+4+5=13
2+3+4+5=14
1+2+3+4+5=15
1+2+3=6 and 2+1+3=6 are treated as the same combination.
[ Last edited by namejm on 2006-12-29 at 09:55 PM ]
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
考虑问题复杂化,解决问题简洁化。

DigestI