package ch01;
import java.util.Scanner;
public class string1
{
public static void main(String[] args)
{
String s=" ";
//String s1="0";
System.out.print("请输入一串字符:");
while(!s.equals("0"))
{
try
{
Scanner reader=new Scanner(System.in);
s=reader.next();
}
catch(Exception e)
{
e.printStackTrace();
}
if(s.equals("0"))
{
System.out.println("输入结束!");
System.exit(0);
}
System.out.println("您输入的字符串是:"+s);
System.out.print("请输入一串字符:");
}
}
}