import java.util.*;
public class ArraySortScore { //完成 main 方法
public static void main(String[] args) { int counter=0;
int[] scores=new int[]{89 , -23 , 64 , 91 , 119 , 52 , 73};
SortScore(scores);
int index=0;
while(index<scores.length)
{
System.out.println(scores[index]);
index+=1;
}
System.out.println("考试成绩的前三名为:");
index=0;
while(index<scores.length)
{
if(scores[index]>=0 && scores[index]<=100)
{
System.out.println(scores[index]);
counter+=1;
if(counter==3)
break;
}
index+=1;
} } //定义方法完成成绩排序并输出前三名的功能
public static void SortScore(int[] scores)
{
Arrays.sort(scores);
} }
---------- java ----------
-23
52
64
73
89
91
119
考试成绩的前三名为:
52
64
73 Output completed (0 sec consumed) - Normal Termination

最新文章

  1. 控制台查看原生sql
  2. scanf、printf、gets、puts的应用及区别
  3. jQuery 自定义扩展,与$冲突处理
  4. [转]SVN的trunk branch tag
  5. PHP超级全局变量总结
  6. webapp 微信开发适配问题
  7. LINUX下的远端主机登入 校园网络注册 网络数据包转发和捕获
  8. 金融&amp;业务常识积累
  9. 【BZOJ2037】Sue的小球(动态规划)
  10. vue 中使用promise
  11. windows最简单的局部截图工具
  12. Gym - 101848B Almost AP 暴力
  13. http协议、web服务器、并发服务器(下)
  14. 使用 OpenSSL 创建私有 CA:3 用户证书
  15. JS之事件机制
  16. js实现双向链表
  17. [CF587F]Duff is Mad[AC自动机+根号分治+分块]
  18. html图片链接不显示图片
  19. mysql只读模式的设置方法与实验【转】
  20. PHP----练习-----三级联动

热门文章

  1. AQS2--出队
  2. 前端与算法 leetcode 36. 有效的数独
  3. 彻底解决springboot修改页面和代码会自动重启
  4. 【数据结构与算法】线性表操作(C++)
  5. SpringBoot 基础(二)
  6. ZYNQ笔记(6):普通自定义IP封装实现PL精准定时中断
  7. 【搬运工】RHEL6.5 移植使用CentOS 的YUM 步骤
  8. FusionInsight大数据开发---MapReduce与YARN应用开发
  9. 配置两个不同kerberos认证中心的集群间的互信
  10. 我的第一个netcore2.2 api项目搭建(一)