How to work with large numbers?

Possible duplicates:
"BigInt" in C?
How to implement a big int in C ++

How do we work with large numbers without using external libraries and functions?

Some problems are as follows:

What is the sum of the digits of the number 21000?

Design the first ten digits of the sum of the next one hundred and fifty-digit numbers.

37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
8926........................................771585
42502016545090413245809786882778948721859655517457
72107838435069186155435662884062257473692284509516
20849603980134001723930671666823555245252804609722
53503534226472524250874054075591789781264330331690

(this list goes on ...)

How would you decide to solve such problems? Which approach can i use?

Thanks in advance.

* By the way, these problems are taken from Project Euler, but many other cases exist not only there. I found them just for an example.

+3
source share
2 answers

GMP, GNU. , .

+4

bigint .

+1

Source: https://habr.com/ru/post/1755514/


All Articles