You are viewing a single comment's thread. Return to all comments →
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.printf("%d %s\n", i++, scan.nextLine()); } scan.close(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Java End-of-file
You are viewing a single comment's thread. Return to all comments →