Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.TreeMap;
- public class ExamScore {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- scan.nextLine();
- scan.nextLine();
- scan.nextLine();
- TreeMap<Integer, TreeMap<String, Float>> usersInfo = new TreeMap<>();
- while (true) {
- String line = scan.nextLine();
- if (line.contains("-")) {
- break;
- }
- String[] nums = line.split("[^.0-9]+");
- String[] all = line.split("[|]+");
- System.out.println();
- // String name = all[0];
- System.out.println();
- String person = all[1].trim();
- int score = Integer.parseInt(nums[1]);
- float grade = Float.parseFloat(nums[2]);
- // System.out.println(person +" "+score + " "+grade);
- if (!usersInfo.containsKey(score)) {
- usersInfo.put(score, new TreeMap<String, Float>());
- }
- if (!usersInfo.get(score).containsKey(person)) {
- usersInfo.get(score).
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement