import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class day1 {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(new File("input"));
List<Integer> l = new ArrayList<Integer>();
while (s.hasNextInt()) {
l.add(s.nextInt());
}
for (Integer i : l) {
System.out.println(i);
}
}
}
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class day1 {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(new File("input"));
List<Integer> l = new ArrayList<Integer>();
while (s.hasNextInt()) {
l.add(s.nextInt());
}
for (Integer i : l) {
System.out.println(i);
}
}
}
Files.lines(Paths.get(file)).mapToInt(Integer::valueOf).collect(Collectors.toList())
streams make this even cuterthrow
or catch
?
if_ok!
macro)%APPDATA%\Teeworlds