문제

I have to multiply two big numbers - saved as string - any hint how to do that?

도움이 되었습니까?

해결책

Think back to grade school, and how you would solve the problem long-hand.

다른 팁

Depends on the language and how large the numbers are. For example in C, you can convert string to int with atoi and then multiply if the product will fit in 32bit int. If number is too large for 32bit you'll probably have to use third-party BigInt library. Some languages (python, haskell) have built-in support for bigint, so you can multiply numbers of any size.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top