public class Cj {
public static void main(String[]args){
int x=100;
switch(x/100){
case:10
case:9
case:8
System.out.println("优");
break;
case: 7
case: 6
System.out.println("良");
break;
default:
System.out.println("不及格");
}
}
}
这个程序运行错的,请问哪里错了,帮改下
----------------解决方案--------------------------------------------------------
[CODE]public class Cj {
public static void main(String[]args){
int x=100;
switch(x/100){
case 10:
case 9:
case 8:
System.out.println("优");
break;
case 7:
case 6:
System.out.println("良");
break;
default:
System.out.println("不及格");
}
}
}[/CODE]
语法错误
----------------解决方案--------------------------------------------------------
public class Cj {
public static void main(String[]args){
int x=100;
switch(x/100){
case 10:
case 9:
case 8:
System.out.println("优");
break;
case 7:
case 6:
System.out.println("良");
break;
default:
System.out.println("不及格");
}
}
}
case 10:
case 9:
case 8:
注意冒号的位置
----------------解决方案--------------------------------------------------------
永远都是不及格啊~~~~~
----------------解决方案--------------------------------------------------------
public class Cj {
public static void main(String[]args){
int x=100;
switch(x/10){
case 10:
case 9:
case 8:
System.out.println("优");
break;
case 7:
case 6:
System.out.println("良");
break;
default:
System.out.println("不及格");
}
}
}
----------------解决方案--------------------------------------------------------
public class Cj {
public static void main(String[]args){
int x=100;
switch(x/10){
case 10:
case 9:
case 8:
System.out.println("优");
break;
case 7:
case 6:
System.out.println("良");
break;
default:
System.out.println("不及格");
}
}
}
----------------解决方案--------------------------------------------------------
你100除100等于1,当然不及格啦
----------------解决方案--------------------------------------------------------
不知道怎么改进
----------------解决方案--------------------------------------------------------
这个写的不知道在写什么...
----------------解决方案--------------------------------------------------------
调试的时候出了什么错误 把错误贴出来撒 我们又不是JRE
----------------解决方案--------------------------------------------------------