码迷,mamicode.com
首页 > 编程语言 > 详细

python对拍程序

时间:2015-08-16 18:09:00      阅读:334      评论:0      收藏:0      [点我收藏+]

标签:

 

 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对拍程序

标签:

原文地址:http://www.cnblogs.com/chxer/p/4734577.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!