import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.Scanner; public class Main { public static void main(String[] args)throws FileNotFoundException { FileInputStream fis = new FileInputStream("input.txt"); System.setIn(fis); PrintStream ps = new PrintStream(new FileOutputStream("output.txt")); System.setOut(ps); Scanner cin=new Scanner(System.in); int n; while(cin.hasNext()) { n=cin.nextInt(); System.out.println(n); } } }
java 重定向
2015年12月03日 20:11