GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Oct-2009, 04:33
gandalf215 gandalf215 is offline
New Member
 
Join Date: Oct 2009
Posts: 1
gandalf215 is on a distinguished road

"Particular" Recursive Sum in array


Hello,

I have this problem: Given an array, his lenght and a numer (sum), in output the alghoritm must return all the way to obtain that sum.
For example:

8, 11, 8, 7, 7, 6, 5, 4, 3, 2, 2, 1, 1 (where the first 8 is the sum to obtain and 11 is the number of the elements).

Output:

8
7+1
6+2
5+3
5+2+1
4+3+1
4+2+2
4+2+1+1
3+2+2+1

The algorithm must be recursive...

Any idea??

Thank's...
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
where is the problem and can you fix it (php) oggie MySQL / PHP Forum 8 14-Apr-2008 16:08
Getting a line error in register oggie MySQL / PHP Forum 5 13-Apr-2008 17:16
What is an array? Howard_L C Programming Language 3 05-Oct-2007 06:11
How to sort in C++ alphabetically wilen C++ Forum 5 20-Apr-2007 15:43
Need help deleting the last element in the array headphone69 C++ Forum 2 15-Mar-2006 20:31

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:52.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.