public static void main(String[] args) { DataInputStream in = new DataInputStream( new BufferedInputStream(System.in)); String s; try { while((s = in.readLine()).length() != 0) System.out.println(s); // An empty line terminates the program } catch(IOException e) { e.printStackTrace(); } }
DataInputStream in =
new DataInputStream(
new BufferedInputStream(System.in));
String s;
try {
while((s = in.readLine()).length() != 0)
System.out.println(s);
// An empty line terminates the program
} catch(IOException e) {
e.printStackTrace();
}
}
public class test
{
public static void main(String args[])
{
System.out.println("please input String:");
try {
DataInputStream in = new DataInputStream(new BufferedInputStream(System.in));
String s;
while((s = in.readLine()) != null)
{
if(s.equals("bye")) return;
System.out.println(s);
}
} catch(IOException e) {
e.printStackTrace();
} }
}
public class test
{
public static void main(String args[])
{
String[] aryS ;
System.out.println("please input String:");
try {
DataInputStream in = new DataInputStream(new BufferedInputStream(System.in));
String s; while((s = in.readLine()) != null)
{
if(s.equals("bye")) return;
int l ;
for(int i=0;i<s.length();i++){
if(s.charAt(i)==',')
l++;
}
aryS = new String[l+1];
aryS = s.split(",");
System.out.println(s);
} } catch(IOException e) {
e.printStackTrace();
} } }
public class test
{
public static void main(String args[])
{
String[] aryS ;
System.out.println("please input String:");
try {
DataInputStream in = new DataInputStream(new BufferedInputStream(System.in));
String s; while((s = in.readLine()) != null)
{
if(s.equals("bye")) return;
int l =0;
for(int i=0;i<s.length();i++){
if(s.charAt(i)==',')
l++;
}
aryS = new String[l+1];
aryS = s.split(",");
//System.out.println(s);
for(int j=0;j<aryS.length;j++){
System.out.println( aryS[j] );
}
} } catch(IOException e) {
e.printStackTrace();
} } }