Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Best(ArrayList<Chapionist> active) throws NumberFormatException, IOException {
- ArrayList<Points> pontszamok = new ArrayList<Points>();
- BufferedReader be = new BufferedReader(new FileReader("pontok.txt"));
- String Line;
- String LineSpliting[];
- while ((Line = be.readLine()) != null) {
- LineSpliting = Line.split(" ");
- pontszamok.add(new Points(LineSpliting[0], Integer.parseInt(LineSpliting[1])));
- }
- be.close();
- pontszamok.sort(Comparator.comparing((Points f) -> f.getPontszam()).reversed());
- ArrayList<Integer> asd = new ArrayList<Integer>();
- for (Points c : pontszamok) {
- if (asd.contains(c.getPontszam())) {
- asd.add(c.getPontszam());
- }
- if (asd.size() == 3) {
- break;
- }
- }
- for (Points p : pontszamok) {
- int pontindex = asd.indexOf(p.getPontszam());
- if (pontindex == -1) {
- break;
- } else {
- System.out.println(pontindex + 1 + ".dij" + p);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement