JAVA EOF HACCKERANK

 import java.io.*;

import java.util.*;

public class Solution {

    public static void main(String[] args) throws Exception{
       InputStreamReader r=new InputStreamReader(System.in);
       BufferedReader br=new BufferedReader(r);
       String str = "";
       int count=0;
        while ((str = br.readLine()) != null) {
           count++;
            System.out.println(count+" "+str);
        }
        br.close();
    }
}

Comments

Popular posts from this blog

Solutions Of Practice Questions Dated 01-06-2022

CODEFORCES SPY DETECTED ROUND 713

Maximum Winning Score Geeks For Geeks