We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Scanner scan=new Scanner(System.in);
int i=0;
while(scan.hasNext())
{
i++;
String a=scan.nextLine();
System.out.print(i+" "+a +"\n");
}
this will be the more precisely solution to this question!
Java End-of-file
You are viewing a single comment's thread. Return to all comments →
Scanner scan=new Scanner(System.in); int i=0; while(scan.hasNext()) { i++; String a=scan.nextLine(); System.out.print(i+" "+a +"\n"); } this will be the more precisely solution to this question!