Continued Fractions Type: Math Diff: 3.0
Tricks
To solve this problem I use, what's like the rules of finding gcd with Eucldian method. The algorithm of this problem is as follows:
1. I <- // a is the nominator and b is the denominator.
2. print I
3. a = a- b * I;
4. while a != 1
a. swap a & b
b. I =
c. Print I
d. a = a-b*I;
5. print b
Related Problems & Topics
If you have any advice, complements
or proposal, please Send mail to Author
Submit