Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: fb_series
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { static int fibonacci(int n) { int a = 0, b = 1, c; if (n == 0) return a; for (int i = 2; i <= n; i++) { c = a + b; a = b; b = c; } return b; } public static void main (String args[]) { int input = 5; System.out.println(fibonacci(input)); } }
run
|
edit
|
history
|
help
0
OBF-7 4
1
상속2
1a
// Java Coding Challenge - 07: Print out Fibonacci number 0 - 1000
Smallest Multiple of N with Zeros and Ones
Desvio Padrão - LPI
JAVA # Rastgele 15 sayıdan oluşan bir dizinin EK-EB ve Ortalamasını bulan Java Kodu
Leetcode 297. Serialize and Deserialize Binary Tree
1a