假设输入的文件名为test.in (也可以为demo.txt),我的程序名为demo.py,首先cmd命令切换到py文件工作目录下,如 cd desktop(cd C:Userssldndesktop)
1.将test.in 内容输入到程序里面命令 cmd窗口运行python demo.py test.in2.如果想把程序的输出记录保存到结果为test.out的文件当中 命令如下
python demo.py test.in test.out程序设计赛输入输出注意
1.input()函数省略了末尾换行符 n 。
2.sys模块下的stdin.readline()不会删除换行符 但是执行速度是input()语句的4倍。
import sys a,b map(int,sys.stdin.readline().split())



