Description redits: Programming Challenges by Steven S Skiena and Miguel A. Revilla The problem is as follows: choose a number. reverse its digits and add it to the original. If the sum contains even...


Description redits: Programming Challenges by Steven S Skiena and Miguel A. Revilla The problem is as follows: choose a number. reverse its digits and add it to the original. If the sum contains even digits, repeat this procedure e 195 Gnitial number)+ 591 (reverse of initial number)-786 786+687 1473 1473 +3741-5214 5214 + 4125-9339 (no even digits) In this particular case the frst result with no even digits (9339) appeared after the 4th addition This method leads to numbers without even digit Input Your program should read lines of text from standard input. Each line will contain an integer n 4294.967295. Assume each line of İnput will alw computable with less than 1000 iterations (additions). Output For each line of input. generate a line of output which is the number of iterations (additions) to compute first result without even digits and the res and separated by a single space character




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here