49 lines
1.4 KiB
Cheetah
49 lines
1.4 KiB
Cheetah
package src;
|
|
|
|
import java.io.FileReader;
|
|
import java.time.Duration;
|
|
import java.time.Instant;
|
|
import java.util.Scanner;
|
|
|
|
public class Day00 {
|
|
public static void main(String[] args) {
|
|
Instant start = Instant.now();
|
|
part1();
|
|
Instant middle = Instant.now();
|
|
part2();
|
|
Instant end = Instant.now();
|
|
IO.println("part 1: " + Duration.between(start, middle).toMillis() + " ms");
|
|
IO.println("part 2: " + Duration.between(middle, end).toMillis() + " ms");
|
|
}
|
|
|
|
private static void part1() {
|
|
try (Scanner scanner = new Scanner(new FileReader("resources/inputs/00/input"))) {
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
while (scanner.hasNextLine()) {
|
|
sb.append(scanner.nextLine());
|
|
sb.append("\n");
|
|
}
|
|
String input = sb.toString();
|
|
IO.println(input);
|
|
} catch (Exception e) {
|
|
IO.println(e.getMessage());
|
|
}
|
|
}
|
|
|
|
private static void part2() {
|
|
try (Scanner scanner = new Scanner(new FileReader("resources/inputs/00/input"))) {
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
while (scanner.hasNextLine()) {
|
|
sb.append(scanner.nextLine());
|
|
sb.append("\n");
|
|
}
|
|
String input = sb.toString();
|
|
IO.println(input);
|
|
} catch (Exception e) {
|
|
IO.println(e.getMessage());
|
|
}
|
|
}
|
|
}
|