You are viewing a single comment's thread. Return to all comments →
Scanner s1=new Scanner(System.in); int val=1; while(s1.hasNext()) { String word=s1.nextLine(); System.out.printf("%d %s\n",val,word); val++;
}
s1.close();
Seems like cookies are disabled on this browser, please enable them to open this website
Java End-of-file
You are viewing a single comment's thread. Return to all comments →
Scanner s1=new Scanner(System.in); int val=1; while(s1.hasNext()) { String word=s1.nextLine(); System.out.printf("%d %s\n",val,word); val++;
s1.close();