write a program to add two large integers with up to 300 digits one approcah is to treat each number as al list each of whose element is a block of digit of the number for example the integer 179.534.672.198 might be stored with block [0] =198 block [1] =672 block [2] = 534 block [3] = 179 then add to integer (lists) element by elment carrying from one elment to the next elment when necessary
Write a program to add two large integers with up to 300 digits. One approach is to treat each number a list, each of whose elements is a block of digits of the number; for example, the integer "179,534,198" might be stored with block [0] = 198, block [1] = 672, block[2] = 534 and block [3] = 179.
Then add to integer lists element by element carrying from one element to the next when necessary.
I translated it into legible English, although I'm unsure what the last sentence is meant to mean.
That looks like you should make a LIFO stack (an std::vector of ints?) and each element is <= a tenth of the total number.
You would use std::cin to get a 3 digit number and then store it to the vector with vector.push_back(new_3_digit_number).
jsmith is right, that is easy. I hope I clarified things.
the Qu is addition 2 array by addition them by 3 digit on evrey block and when u + them like 198+926=1124 its will record it by using 3 digit 1.124 this will record 124 in first block but how we will + 1 to the next block .
if u can write it C++ not C++ data structures
plzzzz
thx for help
You have to write some code for it yourself first; we'll help you with individual errors. The answer would depend on how you are implementing all of it.