Editing Talk:2835: Factorial Numbers
Please sign your posts with ~~~~ |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 120: | Line 120: | ||
perform this in one or two lines, where as a language like c++ will be longer. | perform this in one or two lines, where as a language like c++ will be longer. | ||
β | The simplest algorithm is to generate the digits from right to left one at time by dividing the number by a per-iteration-incrementing radix starting from 2 (because 1 is simply '0', we start from 2) | + | The simplest algorithm is to generate the digits from right to left one at time by dividing the number by a per-iteration-incrementing radix starting from 2 (because 1 is simply '0', we start from 2) until the quotient reaches zero: |
#include <iostream> | #include <iostream> |