为了账号安全,请及时绑定邮箱和手机立即绑定

请求前辈告诉这哪里错了???

请求前辈告诉这哪里错了???

诸葛浅忆 2017-05-08 14:02:11
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.println("考试前三名的成绩为:");        hellWord hello = new HelloWorld();        hello.showTop3(scores)        }            public void showTop3(int[] scores){        Arrays.sort(scores);        int num = 0;        for(int i = scores.length-1 ; i >= 0 ; i--){            if(scores[i] <0 || scores[i] > 100){                continue;            }            num++;            if(num>3){                break;            }            System.out.println(scores[i]);        }    }}
查看完整描述

2 回答

已采纳
?
yanrun

TA贡献317条经验 获得超240个赞

//img1.sycdn.imooc.com//59100c3c000163bc04750319.jpg都在图里了

查看完整回答
反对 回复 2017-05-08
  • 诸葛浅忆
    诸葛浅忆
    谢谢前辈
  • 诸葛浅忆
    诸葛浅忆
    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.println("考试前三名的成绩为:"); HelloWord hello = new HelloWorld(); hello.showTop3(scores); } public void showTop3(int[] scores){ Arrays.sort(scores); int num = 0; for(int i = scores.length-1 ; i >= 0 ; i--){ if(scores[i] <0 || scores[i] > 100){ continue; } num++; if(num>3){ break; } System.out.println(scores[i]); } } } //定义方法完成成绩排序并输出前三名的功能 为什么还会错呢???前辈???
  • yanrun
    yanrun
    HelloWord hello = new HelloWorld();你又拼错了
点击展开后面2
?
回到原点co

TA贡献2条经验 获得超0个赞

 hello.showTop3(scores);以分号结尾

查看完整回答
反对 回复 2017-05-08
  • 2 回答
  • 0 关注
  • 1761 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信