factoring binomials

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2008
Posts: 86
Reputation: gregorynoob is an unknown quantity at this point 
Solved Threads: 5
gregorynoob gregorynoob is offline Offline
Junior Poster in Training

Re: factoring binomials

 
0
  #11
Oct 6th, 2008
i still don't really get it... if the input is in shape of (ax+b)(cx+d) you can easily solve this to acx^2+x(ad+bc)+bd, which you can simply extract from your string looking at them as being just sequences of digits. i still think the problem is not defined well, for example can the input be (1+7)(15-3)?
if the input is in the above style you don't have to implement fancy parsing.
i guess this: acx^2+x(ad+bc)+bd solves 'adding the x'es'.
Last edited by gregorynoob; Oct 6th, 2008 at 6:07 pm.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 675
Reputation: Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold Sky Diploma is a splendid one to behold 
Solved Threads: 100
Sky Diploma's Avatar
Sky Diploma Sky Diploma is offline Offline
Practically a Master Poster

Re: factoring binomials

 
0
  #12
Oct 6th, 2008
Well yes, That is easy. But i am trying to implement a function that will give me the output as a string and secondly will work for any sequence taking String as a parameter.

in your way , if i input (x-a)(x-b)(x-c)
You will not be getting the right answer right.

That is what i am willing to do.

Write a program that will multiply each of its term with the other terms and then generate a string as the answer.
1. Please Mark Your Thread as Solved After Getting Your Answers.
2. Please Use CODE TAGS .
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 13
Reputation: acoxia is an unknown quantity at this point 
Solved Threads: 0
acoxia's Avatar
acoxia acoxia is offline Offline
Newbie Poster

Re: factoring binomials

 
0
  #13
Oct 8th, 2008
well thanks for the advice all the atoi() came in really handy and sky yours bit more complicated then mine needs to be, hope it worked out well
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC