JAVA程序点击 run as没反应是怎么回事
packageweek1;importjava.util.Scanner;publicclassHome{publicstaticvoidmain(String[]arg...
package week1;
import java.util.Scanner;
public class Home {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int b=scan.nextInt();
b= fbn(10);
System.out.println("输出的数为:"+b);
}
public static int fbn(int a){
int [] chs=new int [20];
chs[0]=1;
chs[1]=1;
for(int i=2;i<chs.length;i++){
chs[i]=(int)chs[i-1]+(int)chs[i-2];
}
return chs[a];
}
} 展开
import java.util.Scanner;
public class Home {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int b=scan.nextInt();
b= fbn(10);
System.out.println("输出的数为:"+b);
}
public static int fbn(int a){
int [] chs=new int [20];
chs[0]=1;
chs[1]=1;
for(int i=2;i<chs.length;i++){
chs[i]=(int)chs[i-1]+(int)chs[i-2];
}
return chs[a];
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询