Advertisement
ibakyrdjiev

Untitled

Sep 20th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.TreeMap;
  3.  
  4. public class ExamScore {
  5.     public static void main(String[] args) {
  6.         Scanner scan = new Scanner(System.in);
  7.         scan.nextLine();
  8.         scan.nextLine();
  9.         scan.nextLine();
  10.  
  11.         TreeMap<Integer, TreeMap<String, Float>> usersInfo = new TreeMap<>();
  12.         while (true) {
  13.  
  14.             String line = scan.nextLine();
  15.             if (line.contains("-")) {
  16.                 break;
  17.             }
  18.             String[] nums = line.split("[^.0-9]+");
  19.             String[] all = line.split("[|]+");
  20.             System.out.println();
  21.             // String name = all[0];
  22.             System.out.println();
  23.             String person = all[1].trim();
  24.             int score = Integer.parseInt(nums[1]);
  25.             float grade = Float.parseFloat(nums[2]);
  26.             // System.out.println(person +" "+score + " "+grade);
  27.             if (!usersInfo.containsKey(score)) {
  28.                 usersInfo.put(score, new TreeMap<String, Float>());
  29.             }
  30.             if (!usersInfo.get(score).containsKey(person)) {
  31.                 usersInfo.get(score).
  32.             }
  33.  
  34.         }
  35.  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement