diff --git a/Java/01. Introduction/09. Java End-of-file/Solution.java b/Java/01. Introduction/09. Java End-of-file/Solution.java new file mode 100644 index 0000000..902f4f4 --- /dev/null +++ b/Java/01. Introduction/09. Java End-of-file/Solution.java @@ -0,0 +1,19 @@ +// Problem: https://www.hackerrank.com/challenges/java-end-of-file +// Difficulty: Easy +// Score: 10 + + +import java.util.Scanner; + +public class Solution { + + public static void main(String[] args) { + Scanner s = new Scanner(System.in); + int ctr = 1; + while (s.hasNext()) { + System.out.println(ctr + " " + s.nextLine()); + ctr++; + } + s.close(); + } +}