package lianxiti; import java.io.IOException; import java.io.PrintWriter; import java.util.Scanner; public class Test2 { public static void main(String[] args) throws IOException { Scanner s=new Scanner(System.in); System.out.println("请输入第一句话"); String ss=s.nextLine(); Scanner sg=new Scanner(System.in); System.out.println("请输入第二句话"); String sf=sg.nextLine(); PrintWriter pw=new PrintWriter("d:/zyy/test.txt"); pw.print(ss); pw.print(sf); pw.close(); s.close(); } }