|
-
February 25th, 2016, 06:51 PM
#1
How to distribute a value into vector
Hi i need help to distribute a value into a vector and print all possible combination for example
If a user input first value that will be the vector size input1size = 15;
Then input2 is the value going to distribute inside the vector . input2 =25;
3rd input is first constant value of the vector input3 = 2 ; then this value minus input2 is the value i need to distribute inside vector
After the distribution vector look like this . When we add vector
Data together the output need to be = to input2 = 25 ; and the first value is user input3;
V1 = {2,9,2,1,1,1,1,1,1,1,1,1,1,1,1} = 25;
V1 = {2,9,1,2,1,1,1,1,1,1,1,1,1,1,1} = 25;
V1 = {2,9,1,1,2,1,1,1,1,1,1,1,1,1,1} = 25;
.........
V1 = {2,1,1,1,1,1,1,8,1,1,1,1,1,1,3} = 25;
So on ..... and find all sequences
How can i do this ...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|