python对拍程序,, 1 import


 1 import sys 2 f1=open("std.out","r"); 3 f2=open("shacha.out","r"); 4 f3=open("result.txt","w"); 5 cnt=1;tot=0; 6 while True: 7     a1=f1.readline(); 8     if not a1:break; 9     a2=f2.readline();10     if(a1!=a2):11         tot=tot+1;12         f3.write("line"+str(cnt)+‘:‘+str(a1)+"?"+str(a2)+"\n");13     cnt=cnt+1;14 if not tot:15     f3.write("All Good!");16     print("All Good!");17 else:18     print("Not Good!There‘re "+str(tot)+" Wrongs!You Must Check Your Program!");19 f1.close();20 f2.close();21 f3.close();

python对拍程序

相关内容

    暂无相关文章

评论关闭