第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

可是這組代碼里面的equals明顯比較的是兩個變量的值???求解

package Math;

import java.util.Scanner;

import java.util.Arrays;

public class 裴波那契數(shù)列 {

public static void main(String [] args){

System.out.println("*****裴波那鍥數(shù)列*****");

Scanner input=new Scanner(System.in);

裴波那契數(shù)列 對象 =new 裴波那契數(shù)列();

對象.survey();

for(int i=1;;){

System.out.println("您需要再次測試嗎?");

System.out.println("回答“Y”or“N”");

? ? ? ? String x=input.next();

? ? ? ? String s1="y",s2="Y",s3="n",s4="N";

? ? ? ? if(x.equals(s1)){

? ? ? ? 對象.survey();

? ? ? ? i++;

? ? ? ? }

else if(x.contentEquals(s2)){

對象.survey();

i++;

}

else if(x.contentEquals(s3)){

System.out.println("測試"+i+"次.");

break;

}

else if(x.equals(s4)){

System.out.println("測試"+i+"次.");

break;

}

else{

System.out.print("您的輸入有誤,請問");

}

? ?}

}

public ?void survey(){

Scanner input=new Scanner(System.in);

System.out.println("***請輸入長度***");

int c=input.nextInt();

for(int leng=c;c<2;){

System.out.println("您的輸入有誤,請重新輸入");

c=input.nextInt();

}

for(int leng=c;c>45;){

System.out.println("您的輸入有誤,請重新輸入");

c=input.nextInt();

}

int scores[]=new int[c];

scores[0]=1;

scores[1]=1;

for(int i=2;i<scores.length;i++){

scores[i]=scores[i-2]+scores[i-1];

}

System.out.println("結(jié)果:");

System.out.println(Arrays.toString(scores));

}

}


正在回答

1 回答

。。。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

可是這組代碼里面的equals明顯比較的是兩個變量的值???求解

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號