java 相当于c++中的freopen的语句
System.setIn(new BufferedInputStream(new FileInputStream("c://1754.in")));
Main函数必须改成
public static void main(String[] args) throws IOException
文章详细介绍了如何在Java中使用System.setIn方法等效于C++中的freopen函数,用于改变标准输入流。通过示例代码展示了如何修改主函数以实现输入文件的指定。
java 相当于c++中的freopen的语句
System.setIn(new BufferedInputStream(new FileInputStream("c://1754.in")));
Main函数必须改成
public static void main(String[] args) throws IOException
558
4113

被折叠的 条评论
为什么被折叠?