+ 1
Multiplying large numbers?
https://code.sololearn.com/cdXr7GI7JDu0/?ref=app How can I make this code spit out a hundred digit integer properly? If you have a better method of doing so, share it, but for clarification, I'll tell you what this function should do: The function should generate a random number with as many digits as the number in the parameter. So if the param is 5, it'll generate a 5 digit random number. The problem is when the parameter is a large number, in my example I used 100. I tried using 1LL but it didn't work.
3 ответов
+ 2
Does digit by digit work by you?
Then randomize digits and output them one after another as an array or string.
If you need to calculate with such a number, you'd have to write a code that does it (integer) digit by digit, like in elementary school on paper.
One related example of my own:
https://code.sololearn.com/cV3o3NWxVZ11/?ref=app
+ 1
I was hoping to store it as a single int, as I could easily do it using a vector. Lol
+ 1
A promising keyword for googling what's out there would be 'big num C++'.