import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n1 = sc.nextInt(),n2 = sc.nextInt();
String[] arr1 = new String[2*n1];
String[] arr2 = new String[n1];
Double[] arr3 = new Double[n1];
for(int i = 0;i < n1;i ++){
String str = sc.next();
double score = sc.nextDouble();
arr2[i] = str;
arr3[i] = score;
arr1[i*2] = str;
arr1[i*2+1] = Double.toString(score);
}
for(int i = 0;i < arr3.length;i ++){
for(int j = 0;j < arr3.length - 1 - i;j ++){
if(arr3[j]<arr3[j+1]){
double temp = arr3[j];
arr3[j] = arr3[j+1];
arr3[j+1] = temp;
}
}
}
for(int i = 0;i < arr3.length;i ++){
if(Double.parseDouble(arr1[i*2+1])==arr3[n2-1]){
System.out.println(arr1[i*2]+" "+Double.toString(arr3[n2-1]));
}
}
}
}
0.0分
1 人评分
1065浏览:872 |
2005年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:772 |
汽水瓶 (C++代码)(直接n/2就可以了)浏览:1138 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:623 |
程序员的表白 (C语言代码)浏览:1462 |
矩形面积交 (Java代码)浏览:1281 |
C语言训练-求素数问题 (C语言代码)浏览:1509 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)for循环浏览:1178 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:700 |
妹子杀手的故事 (C语言代码)浏览:1297 |