标签:public
}
class TestSwitch5 { public static void main(String[] args) { int score=57; if(score>=60){ System.out.println("及格"); }else{ System.out.println("不及格"); } switch(score/10){ case 10: System.out.println("及格"); break; case 9: System.out.println("及格"); break; case 8: System.out.println("及格"); break; case 7: System.out.println("及格"); break; case 6: System.out.println("及格"); break; case 5: System.out.println("不及格"); break; case 4: System.out.println("不及格"); break; case 3: System.out.println("不及格"); break; case 2: System.out.println("不及格"); break; case 1: System.out.println("不及格"); break; case 0: System.out.println("不及格"); break; default: System.out.println("输入有误"); } switch(score/10){ case 10: case 9: case 8: case 7: case 6: System.out.println("及格"); break; case 5: case 4: case 3: case 2: case 1: case 0: System.out.println("不及格"); break; default: System.out.println("输入有误"); } } }
标签:public
原文地址:http://9815936.blog.51cto.com/9805936/1600331