| | |
factoring binomials
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 86
Reputation:
Solved Threads: 5
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'.
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.
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.
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.
![]() |
Other Threads in the C++ Forum
- Previous Thread: getfilepathname() doesnot return correct path
- Next Thread: Preprocessor #warning Command Question
| Thread Tools | Search this Thread |
add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft multidimensional newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive return string strings struct studio template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





