Java End-of-file | HACKERRANK

Updated: Sep 17

Asked: Anonymously | Category: JAVA

import java.io.*;

import java.util.*;

import java.text.*;

import java.math.*;

import java.util.regex.*;


public class Solution {


public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

int l=1;

while(sc.hasNext())

{

System.out.println(l+" "+sc.nextLine());

l++;

}

sc.close();

}

}



6 views

Recent Posts

See All

"Believe you can and you're halfway there"