标签:学生 == void pac ring 筛选 -- exti span
package com.company; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner sc=new Scanner(System.in); int N=sc.nextInt(); int L=sc.nextInt(); int H=sc.nextInt(); int[] id=new int[N]; int[] de=new int[N]; int[] cai=new int[N]; for (int i=0;i<N;i++){ id[i]=sc.nextInt(); de[i]=sc.nextInt();//德分 cai[i]=sc.nextInt();//才分 } System.out.println("----------输出结果----------"); for (int i=0;i<N;i++){ System.out.println(id[i]+" "+de[i]+" "+cai[i]); } System.out.println("----------排序结果----------"); //第一类排序 int sum=0; int j=-1; int[][] stu1=new int[N][2]; for (int i=0;i<N;i++){ if (de[i]>=H&&cai[i]>=H){//筛选学生 j++; stu1[j][0]=id[i]; if (stu1[j][1]<de[i]+cai[i]){ stu1[j][1]=de[i]+cai[i]; }else{ stu1[j][1]=stu1[i][1]; } } } //排序 int temp; Arrays.sort(stu1[j+1]); for (int i=0;i<j+1;i++){ for (int k=0;k<j+1;k++){ if (stu1[i][1]==stu1[k][1]){ } } } //输出第一类人成绩 for (int i=0;i<j+1;i++){ System.out.println(stu1[i][0]+" "+stu1[i][1]); } } }
标签:学生 == void pac ring 筛选 -- exti span
原文地址:https://www.cnblogs.com/zhuzehua/p/9736576.html