Hackerrank – Java Solution – Java End-of-file Solution

Hackerrank - Java Solutions Hackerrank Online Judge Solution

Hackerrank – Java Solution – Java End-of-file Solution

HackerRank Problem Solution

Problem Name –  Java End-of-file
Problem Link –  Java End Of File
Level – Introduction Challenges
Online Judge – HackerRank

Java Code

import java.util.Scanner;

public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int i = 1;
while (scan.hasNextLine()) {
System.out.println(i + " " + scan.nextLine());
i++;
}
scan.close();
}
}

Tags: HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution, Hackerrank – Java Solution – Java End-of-file solution

Leave a Reply

Your email address will not be published.