.
package com.javarush.task.task19.task1923;
import java.io.*;
import java.util.ArrayList;
/*
Слова с цифрами
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
FileWriter writer = new FileWriter(args[1]);
ArrayList<String> list = new ArrayList<>();
while (reader.ready()) {
list.add(reader.readLine());
}
for (String line : list) {
String[] split = line.split(" ");
for (String word : split) {
for (char s : word.toCharArray()) {
if (Character.isDigit(s)) {
writer.write(word + " ");
}
}
}
}
reader.close();
writer.close();
}
}