一个很方便的比较标程数据和自己数据的程序~

能够很方便的在一堆数据中找出不一样的地方,并指出在第几行,数据是XXX···

点我嘛~
 1 #include<iostream>
 2 #include<cstring>
 3 #include<fstream>
 4 #include<cstdlib>
 5 using namespace std;
 6 int main(){
 7     ifstream output("output.txt"); //标程的结果
 8     ifstream me("me.txt"); //自己的程序得到的结果
 9     char str[50];
10     double a,b;
11     int c1=0,c2=0;
12     while(!output.eof() && !me.eof()){
13          output.getline(str,40,'\n');
14          ++c1;
15          sscanf(str,"%lf",&a);
16          me.getline(str,40,'\n');
17          ++c2;
18          sscanf(str,"%lf",&b);
19          if(a!=b){
20               printf("this %d %d line %.2lf %.2lf\n",c1,c2,a,b);
21               system("pause");
22          }
23     }
24     printf("END   0.0");
25     system("pause");
26     return 0;
27 }
原文地址:https://www.cnblogs.com/xdruid/p/2687132.html