C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 10th, 2005, 07:34 PM
BoolBooB BoolBooB is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 36 BoolBooB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 35 m 42 sec
Reputation Power: 4
One for you math gurus...

I'm having problems coming up with an algorythm to solve the following problem:
I need to find three fractions that add up to exactly 1.
They each must have a single digit numerator and a double digit denominator.
I can only use the digits 1-9 and each digit can only be used once.
Example:
1/23 + 4/56 + 7/89 = ???
or
9/12 + 8/34 + 7/56 = ???

HELP!

Reply With Quote
  #2  
Old March 11th, 2005, 11:53 AM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 273 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 35 m 2 sec
Reputation Power: 4
Try this:
1. Start
2. Take three var, iA,iB and iC.
a. Choose any digit and assign it to iA.
b. Choose digit from the remaining eight numbers and assign to iB
c. Repeat step 2b with remaining seven digits and assign to iC.
3. Form number of iB and iC as iC*10 + iB
4. Divide iA by product of step3 to get fraction.
5. Repeat steps 2 - 4 with remaining six numbers and add the resultant to step 4.
6. Repeat step five with remaining 4 numbers.
7. If sum is 1 then print "Success" and goto step 8 else go to step 2.
8. Stop.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > One for you math gurus...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway