|
|
|
|
|
by davidamarquis
3733 days ago
|
|
The algorithm is very nice. But I think you should think about what it means to divide one integer by another. The quotient of that operation is an integer. The remainder is an integer. Can you express the number in terms of the quotient and remainder? Using this expression write an algorithm that outputs the quotient and remainder using only addition, multiplication and checking equality with integers. I think doing this would make the algorithm seem less surprising. |
|