import java.util.Arrays; public class HelloWorld { //完成 main 方法 public static void main(String[] args) { int[] scores={89,-23,64,91,119,52,73}; System.out.prinln("考试成绩的前三名为:"); HelloWorld hello=new HelloWorld(); hello.maxScore(scores); } //定义方法完成成绩排序并输出前三名的功能 public void maxScore(int[] scores){ Arrays.sort(scores); int count=0; for(int i=scores.length-1;i>=0;i--) if(scores[i]<0 || scores[i]>100){ continue; } count++; if(count > 3){ break; } System.out.println(scores[i]); } } 运行错误提示是这样: /85/1598/JSur/HelloWorld.java:7: error: cannot find symbol System.out.prinln("??????????"); ^ symbol: method prinln(String) location: variable out of type PrintStream /85/1598/JSur/HelloWorld.java:23: error: break outside switch or loop break; ^ /85/1598/JSur/HelloWorld.java:25: error: cannot find symbol System.out.println(scores[i]); ^ symbol: variable i location: class HelloWorld 3 errors
朕日理万机
相关分类