Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public class Main {
  2.     static    List<String> list;
  3.    
  4.     static String reverse(String str) {
  5.         Scanner scanner = new Scanner(str);
  6.         int a = scanner.nextInt();
  7.         int b = scanner.nextInt();
  8.         int c = scanner.nextInt();
  9.         int d = scanner.nextInt();
  10.         int e = scanner.nextInt();
  11.         return "" + e + " " + d + " " + c + " " + b + " " + a;
  12.     }
  13.  
  14.     static boolean test(String s){
  15.          return list.contains(reverse(s));
  16.     }
  17.    
  18.     public static void main(String[] args) throws IOException {
  19.         list = Files.readAllLines(Paths.get("file3.txt"));
  20.         list.removeIf(s->test(s));
  21.         Files.write(Paths.get("file3sm.txt"), list);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement