DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Can someone help me. (http://www.daniweb.com/forums/thread160775.html)

chchiu Dec 4th, 2008 5:26 pm
Can someone help me.
 
How to write a program that output the number of different ways of arranging the number so that the displayed numbers add up to a fixed sum inputed byt the used.

For example, suppose the sum is 4. There are 8 different arrangements. It has to be listed in dictionary order.
1 1 1 1
1 1 2
1 2 1
1 3
2 1 1
2 2
3 1
4

ithelp Dec 5th, 2008 4:57 am
Re: Can someone help me.
 
It goes like this
cout << "Do your homework yourself" << endl;


All times are GMT -4. The time now is 10:01 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC