package Lgz;
import java.io.*;
import java.util.*;
import javax.swing.*;
public class xx{
	static Scanner cin = new Scanner(System.in);
	public static void main(String[] args) {
		String s = JOptionPane.showInputDialog("输入路径");
		File fp=new File(s);
		try {//写入文件
			BufferedWriter fout = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fp)));
			fout.write(s);
			fout.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("随便输入一个数:");
		cin.next();//随便输入一个数
		try {//从文件中读出
			BufferedReader fin = new BufferedReader(new InputStreamReader(new FileInputStream(fp)));
			String ss=fin.readLine();
			System.out.println(ss);
			fin.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}