题解 | #斐波那契数列#
斐波那契数列
http://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3
emmm
public class Solution {
public int Fibonacci(int n) {
if(n==1||n==2){
return 1;
}
int o,p,w=0;
o=1;
p=1;
for(int i=0;i<n-2;i++){
w = o + p;
o = p;
p = w;
System.out.print(w);
}
return w;
}
}