国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Java > 正文

java基礎知識總結2

2019-11-06 07:42:16
字體:
來源:轉載
供稿:網友
1:if條件結構:先判斷條件再進行處理if(條件){   //語句}2:if - else語句if(條件)//滿足條件執行語句1{   //語句1}else     //不滿足條件執行語句2{  //語句2}3:多重if語句if(條件1){  //語句1}if(條件2){ //語句2}if(條件3){  //語句4}例如:import  java.util.Scaner;public class Test{public  static void main(String[] args){Scanner in  = new Scanner(System.in);System.out.PRint("請輸入你的成績");int score = in.nextTnt();if(score>90){  System.out.print("優秀");}if(score>=80){System.out.print("良好");}if(score>=60){ System.out.print("及格");}}4:if嵌套語句if(大條件1){if(小條件1){//語句}else{//語句}}else{//語句}5:switch多分支結構import  java.util.Scaner;public class Test{public  static void main(String[] args){Scanner in  = new Scanner(System.in);System.out.print("請輸入你的成績");int xz = in.nextTnt();switch(xz){case 1:{  System.out.print("優秀");break;}case 2:{  System.out.print("優秀");break;}case 3:{  System.out.print("優秀");break;}}}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 隆林| 顺义区| 海原县| 全州县| 确山县| 昭平县| 洞头县| 吉林省| 旅游| 即墨市| 巧家县| 乌兰浩特市| 霸州市| 滨州市| 高雄县| 北宁市| 镇宁| 娱乐| 西和县| 富裕县| 新绛县| 旬邑县| 马关县| 东宁县| 璧山县| 平原县| 平乐县| 镇宁| 高碑店市| 虞城县| 体育| 康保县| 蛟河市| 航空| 吉木乃县| 丹巴县| 朝阳县| 香港 | 蒙阴县| 安溪县| 郸城县|