From f0f5685f7a272335b5b8a06f5165dda2e29ebdcd Mon Sep 17 00:00:00 2001 From: pj3q7x5mz <1732875197@qq.com> Date: Mon, 21 Nov 2022 16:40:57 +0800 Subject: [PATCH] =?UTF-8?q?Delete=20'Java=E5=88=86=E6=94=AF=E7=BB=93?= =?UTF-8?q?=E6=9E=84.txt'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Java分支结构.txt | 101 ------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 Java分支结构.txt diff --git a/Java分支结构.txt b/Java分支结构.txt deleted file mode 100644 index d2dd461..0000000 --- a/Java分支结构.txt +++ /dev/null @@ -1,101 +0,0 @@ -1.Java分支结构之多重if -package step3; - -import java.util.Scanner; - -public class HelloStep3 { - public static void main(String[] args) { - System.out.println("星级成绩评定系统"); - System.out.println("请输入成绩:"); - Scanner sc = new Scanner(System.in); - /******start******/ - int score; - score=sc.nextInt(); - if(score>=90&&score<=100) - { - System.out.print("*****五星成绩"); - } - else if(score<90&&score>=80) - { - System.out.print("****四星成绩"); - } - else if(score<80&&score>=70) - { - System.out.print("***三星成绩"); - - } - else if(score<70&&score>=60) - { - System.out.print("**俩星成绩"); - } - else if(score<60) - { - System.out.print("无星成绩"); - } - - - - - /******end******/ - } -} -2.Java分支结构之Switch -package step4; - -import java.util.Scanner; - -public class HelloSwitch { - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - - System.out.println("请输入月份:"); - - int input = sc.nextInt(); //获取输入的月份 - - //通过输入的月份来判断当前季节并输出 - /*****start*****/ - int season; - switch(input) - { - case 1: - System.out.print("1月是冬天"); - break; - case 2: - System.out.print("2月是冬天"); - break; - case 3: - System.out.print("3月是春天"); - break; - case 4: - System.out.print("4月是春天");break; - case 5: - System.out.print("5月是春天"); - break; - case 6: - System.out.print("6月是夏天"); - break; - case 7: - System.out.print("7月是夏天"); - break; - case 8: - System.out.print("8月是夏天"); - break; - case 9: - System.out.print("9月是秋天"); - break; - case 10: - System.out.print("10月是秋天"); - break; - case 11: - System.out.print("11月是秋天"); - break; - case 12: - System.out.print("12月是冬天"); - break; - } - - - /*****end*****/ - - } -}