Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- static List<String> list;
- static String reverse(String str) {
- Scanner scanner = new Scanner(str);
- int a = scanner.nextInt();
- int b = scanner.nextInt();
- int c = scanner.nextInt();
- int d = scanner.nextInt();
- int e = scanner.nextInt();
- return "" + e + " " + d + " " + c + " " + b + " " + a;
- }
- static boolean test(String s){
- return list.contains(reverse(s));
- }
- public static void main(String[] args) throws IOException {
- list = Files.readAllLines(Paths.get("file3.txt"));
- list.removeIf(s->test(s));
- Files.write(Paths.get("file3sm.txt"), list);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement