亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么這個沒有輸出?

為什么這個沒有輸出?

恆晝 2016-03-13 19:35:46
public class class1 {public static void main(String[] args) {int x=2;?int y;?if(x<=0){?y=0;???}?if (x>0 &&x<=5){??y=2*x+1;???}?else{y=x*x-1;}?System.out.println(y);}{int x = 2;int y;if (x<=0)System.out.println(0);?switch(x){?case 1:?case 2:?case 3:?case 4:?case 5:?{y= 2*x+1;} ?System.out.println(y);?break;?default:?{y=x*x-1;}?System.out.println(y);???}?}}??????
查看完整描述

1 回答

?
taoist

TA貢獻2條經驗 獲得超2個贊

有輸出的,輸出結果是5,執行的是你上面?if (x>0 &&x<=5){y=2*x+1;} 然后輸出System.out.println(y);

查看完整回答
1 反對 回復 2016-03-14
  • 1 回答
  • 0 關注
  • 1289 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號