Dim fso, a, g, b, c, d, log file, e, n
Set fso = CreateObject("Scripting。 File system object ")
set log file = FSO . open textfile(" 56 . txt in 1-22 ",2,true)。
n=0
For a= 1 to 18.
For b=a+ 1 to 19.
For c=b+ 1 to 20.
For d=c+ 1 to 2 1
For e=d+ 1 to 22.
If a<& gtb and b<& gtc and c<& gtd and d<& gte and a<& gtd and a<& gte and b<& gtd and b<& gte and c<& gt, then
If a+b+c+d+e=56, then
g = a & amp"+" & amp; b & amp"+" & amp; c & amp"+" & amp; d & amp"+" & amp; E & amp" = "& 56 years old.
Log file. Write line (g)
n=n+ 1
If ... it will be over.
If ... it will be over.
then
then
then
then
then
g = " * * * Yes " &; N&"The sum of groups is"&; Fifty-six
Log file. Write line (g)
msgbox g
Running results (partial):
1+2+ 10+2 1+22=56
1+2+ 1 1+20+22=56
1+2+ 12+ 19+22=56
1+2+ 12+20+2 1=56
1+2+ 13+ 18+22=56
1+2+ 13+ 19+2 1=56
1+2+ 14+ 17+22=56
1+2+ 14+ 18+2 1=56
1+2+ 14+ 19+20=56
1+2+ 15+ 16+22=56
1+2+ 15+ 17+2 1=56
1+2+ 15+ 18+20=56
1+2+ 16+ 17+20=56
1+2+ 16+ 18+ 19=56
1+3+9+2 1+22=56
1+3+ 10+20+22=56
1+3+ 1 1+ 19+22=56