Skip to content

Commit

Permalink
add java end-of-file
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 11, 2020
1 parent 5e38064 commit 4b5c741
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Java/01. Introduction/09. Java End-of-file/Solution.java
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit 4b5c741

Please sign in to comment.