Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------- Wypisanie najlepszej ------------------------------------------
- System.out.println("Najkrótsza trasa: " +tmpdistance + "\n\n");
- System.out.printf("\nNajlepsza Trasa (indeksy): ::: ");
- for (int j = 0; j < NUMBER_OF_TOURISTS; j++) {
- System.out.printf("%5d", bestIndexes[j]);
- }
- System.out.println();
- //------------------------------- ZAPIS DO PLIKU WYNIKOWEGO ------------------------------------
- try {
- PrintWriter pr = new PrintWriter("berlin52_wynik.txt");
- for (int j=0; j<bestIndexes.length ; j++){
- if(j<bestIndexes.length-1){
- pr.print(bestIndexes[j]+"-");
- } else if (j==bestIndexes.length-1) {
- pr.print(bestIndexes[j]+" ");
- }
- }
- pr.print(tmpdistance);
- pr.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.out.println("No such file exists.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement