L1-005 考试座位号
PTA 团体程序设计天梯赛-练习集 L1-005考试座位号为什么我用java写会超时,换成C++就过了呢, 大神求解 java代码如下:
import java
.util
.Scanner
;
public class Main {
public static void main(String
[] args
) {
Scanner input
= new Scanner(System
.in);
int n
= input
.nextInt();
int b
= 0, c
= 0;
String a
= "";
String
[] f
= new String[1005];
int
[] f1
= new int[1005];
for(int i
= 0; i
< n
; i
++){
a
= input
.next();
b
= input
.nextInt();
c
= input
.nextInt();
f
[b
] = a
;
f1
[b
] = c
;
}
n
= input
.nextInt();
for(int i
= 0; i
< n
; i
++){
b
= input
.nextInt();
System
.out
.println(f
[b
] + " " + f1
[b
]);
}
}
}
转载请注明原文地址: https://www.6miu.com/read-5039240.html