В тестах ручных работает, автоматические я ещё не умею( Помогите, пожалуйста
package com.javarush.task.task19.task1922;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
Ищем нужные строки
*/
public class Solution {
public static List<String> words = new ArrayList<String>();
static {
words.add("файл");
words.add("вид");
words.add("В");
}
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String fileName = reader.readLine();
reader.close();
reader = new BufferedReader(new FileReader(fileName));
int count = 0;
while (reader.ready()) {
count = 0;
String temp = reader.readLine();
for (String word : words
) {
if (temp.contains(word))
count++;
}
// if ((temp.contains(words.get(0)) && temp.contains(words.get(1)) && !temp.contains(words.get(2))) ||
// (temp.contains(words.get(2)) && temp.contains(words.get(1)) && !temp.contains(words.get(0))) ||
// (temp.contains(words.get(0)) && temp.contains(words.get(2)) && !temp.contains(words.get(1)))
// )count++;
if (count==2)
System.out.println(temp);
}
reader.close();
}
}