Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

so i am doing Project Euler 13 for the 100 50 digit numbers. i need to make a function that will add the first 50

so i am doing Project Euler 13 for the 100 50 digit numbers. i need to make a function that will add the first 50 digits into a linked-list of 50 nodes from the for line of the text file where the numbers are. I need to add those first 50 numbers and then on the next line add the next 50 digit number to the previous link-list and do the additon. Example: link-list 113 is the first line from file and so the next line would be something like 765 so 1->1->3 + 7 6 5 = 8->7->8 would be my new linked-list. i need the funtion to print out the final summation of the 100 50 digit numbers and also print out the first ten digits of the final summation. both this prints must be done in same function. image text in transcribed
int main() ifstream inFile; string line; NodePtr head = nullptr; unsigned int number; infile.open('nuns.txt'); if(infile.fail()) { cerr "Error unable to open filel" = 0 && number 9) add_head_1(head, number); infile.close(); cout = 0 && number 9) add_head_1(head, number); infile.close(); cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

Students also viewed these Databases questions