package demoFour;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;
public class AllShap
{
public static final String path = "D:/shap.txt";
public static void main(String[] args) throws IOException
{
File file = new File(path);
fWrite(file, true);
// file.delete();
}
public static void fWrite(File file, boolean isFlag) throws IOException
{
Scanner s = new Scanner(System.in);
BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
if ((!file.exists()))
{
System.out.println("骚瑞");
file.createNewFile();
}
String string = null;
while ((string = s.nextLine()) != null)
{
char temp;
if ((temp = string.charAt(string.length() - 1)) == '~')
{
break;
}
write.write(string);
}
System.out.println("骚瑞~您输入了 \"~\"符号");
write.close();
}
}