It is not first task, when verification is not passed, the same problem with 1825 task. Code gym, please fix that
In one case it is not pass 3 and 4 requirements. in second - program to long..
very disappointed -_-
package com.codegym.task.task19.task1908;
/*
Picking out numbers
*/
import java.io.*;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileReader freader = new FileReader(reader.readLine());
FileWriter fwriter = new FileWriter(reader.readLine());
reader.close();
BufferedReader br = new BufferedReader(freader);
BufferedWriter bw = new BufferedWriter(fwriter);
Scanner sc = new Scanner(br);
sc.useDelimiter("\\s");
while (sc.hasNext()) {
String s = sc.next();
if (s.matches("^\\d+$")){
bw.write(s + " ");
}
}
sc.close();
bw.close();
br.close();
freader.close();
fwriter.close();
}
}