Guest User

Untitled

a guest
Jun 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. class Recursion {
  2. public static int factorial(int n) {
  3. /*
  4. * nの階乗を求めるプログラム
  5. * n! = 1 * 2 * 3 * ... * n
  6. * factorial(1) = 1, factorial(2) = 2, factorial(3) = 6
  7. */
  8. }
  9. public static int fibonacci(int n) {
  10. /*
  11. * フィボナッチ数列を求めるプログラム
  12. * フィボナッチとは,
  13. * fibonacci(0) = 1
  14. * fibonacci(1) = 1
  15. * であり,n>=2について,
  16. * fibonacci(n) = fibonacci(n-1) + fibonacci(n-2)
  17. * が成立する数列
  18. */
  19. }
  20. }
Add Comment
Please, Sign In to add comment