文章标题
来源:互联网 发布:mac版chrome插件下载 编辑:程序博客网 时间:2024/06/06 17:30
package com.cc;
import java.lang.reflect.Array;
import java.util.Arrays;
public class Demo7 {
/** * @param args * 编写一个 JAVA 程序,实现输出考试成绩的前三名 */public static void main(String[] args) { // TODO Auto-generated method stub
Demo7 demo=new Demo7();
int[] score={11,23,45,6,6,78,99,100,54,432,23};
System.out.println(“前三名是:”);
System.out.println(demo.sort(score));
}
public int[] sort(int[] score){
Arrays.sort(score);//排序
int count=0;
for (int i = score.length-1; i>=0;i–) {
if((score[i]<=0)&&(score[i]>=100)){
continue;
}
count++;
if(count>3){//输出最后三名
break;
}
System.out.println(score[i]);
}
return score;
}
}
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- Windows Pe 第三章 PE头文件(中)
- CSS字体
- poj 1287 Networking
- Maven项目SpringMVC+Hibernate+c3p0+mysql+ehcache的pom文件
- COGS 2060
- 文章标题
- writing avocado tests(写avocado测试用例)
- 机器学习资料
- 丹的python学习笔记Day1python安装+我的helloworld
- ReactNative文档翻译-------Native Modules
- WinPcap编程常用函数和数据结构总结
- map/reduce
- android学习之我为什么要学android
- TCP: SYN ACK FIN RST PSH URG 详解