나누기 (정수 구분, 부동 부분은 중요하지 않음) 알고리즘 (100-1000 자리와 같이 매우 큰 수)을 작성해야합니다 (할당되기 때문에 제 3 자 라이브러리를 사용할 수 없음). . http://en.wikipedia.org/wiki/Fourier_division 알고리즘을 찾았지만 올바른 방향인지는 알 수 없습니다. 의견 있으십니까? 과제의 일부가 완전히 원래의 것이 었하지 않는 한매우 큰 숫자를 나누는 알고리즘
1) check divisior < dividend, otherwise it's zero (because it will be an int division)
2) start from the left
3) get equal portion of digits from the dividend
4) if it's divisor portion is still bigger, increment digits of dividend portion by 1
5) multiply divisor by 1-9 through the loop
6) when it exceeds the dividend portion, previous multiplier is the answer
7) repeat steps 3 to 5 until reaching to the end
"과제이기 때문에 ..."숙제 태그를 추가 하시겠습니까? –
종이로 오랫동안 나누면이 문제를 해결하기위한 좋은 알고리즘을 이미 알고 있습니다. –
@Neil : 코드 샘플을 받기를 기대하지 않습니다. 나는이 언어의 한계를 뛰어 넘는 몇 가지 수학 기법을 배우기를 기대하고 있습니다. – pocoa