Java--斐波拉契数列
package com.company; import java.util.Scanner; class l{ int n; int fibo(int n) { int ret; if(n==1 || n==2) return 1; else ret=fibo(n-1)+fibo(n-2); return ret; } } public class Main { public static void main(String[] args) { // write your code here int f; Scanner scan=new Scanner (System.in); f=scan.nextInt(); l t = new l(); System.out.println(+t.fibo(f)); } }