Question: in c++!!! General Description This assignment is adapted from Prolect Euler Question 13. In the given text fille(numsitxt) there are 100 large decimal numbers, where

 in c++!!! General Description This assignment is adapted from Prolect Euler

in c++!!!

General Description This assignment is adapted from Prolect Euler Question 13. In the given text fille(numsitxt) there are 100 large decimal numbers, where each number is 50 -diglt long. Develop a program that utillies STL's linked Ilst to calculate the summation of these numbers. FYi the correct result: 5587876790390876637802048746827985971773659891899672 Requirements - Use fill for the input (nums.txt). No keyboard input should be involved when running the program, Please explore the std:tget1ine(f11estream, astring) function to read each inne intoa string. Then find a way to extra each diglt out of the string (hints string's (l) operator) - (HIIghiy recommended, though not required) Use only one innked IIst throughout your program, iB seems easy to load each inne into a list, but I prefer to work with 111st+100 strings. - Store the num reversely in the Ilinked IIst by breaking each number into digits, for example, the num 123 is stored as 3 (at first node), 2 (at second node) and 1 (at thired node) in the linked Ilst. We go reversely to ease adding operation, as you would start from least significant digitis (IIghtmost) when adding multiple digit numbers (e.8,2,048+1567, you would add 8 and 7 first.) - Write a function that performs the addition of numbers. Thls function will be called in the maln. - Write a function that prints out the answer in regular order. (Hint: reverse iterator for lists?) - Comment the code clearly, especially for the number addition mechanlsm. Note that vouneed to process carry digits from one node to its next. Also note that the length of Ilst will be greater than 50. The final result as Ilsted above has 52 digits

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!