public static void main(String[] args) throws IOException {
System.out.println("请输入数据吧,宝贝");
FileOutputStream fos = new FileOutputStream("text.txt");
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
while(true){
if("quit".equals(s)){
break;
}else {
fos.write(s.getBytes());
}
}
} |
|