mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 06:28:40 +00:00
96d4a3ecf7
Due to historical reasons, the code is in subfolder "1". With SVN removal, we place the code back and remove the annoying "1" folder.
37 lines
772 B
C++
37 lines
772 B
C++
#include "testlib.h"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <sstream>
|
|
|
|
using namespace std;
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
setName("compare files as sequence of lines");
|
|
registerTestlibCmd(argc, argv);
|
|
|
|
std::string strAnswer;
|
|
|
|
int n = 0;
|
|
while (!ans.eof())
|
|
{
|
|
std::string j = ans.readString();
|
|
|
|
if (j == "" && ans.eof())
|
|
break;
|
|
|
|
strAnswer = j;
|
|
std::string p = ouf.readString();
|
|
|
|
n++;
|
|
|
|
if (j != p)
|
|
quitf(_wa, "%d%s lines differ - expected: '%s', found: '%s'", n, englishEnding(n).c_str(), compress(j).c_str(), compress(p).c_str());
|
|
}
|
|
|
|
if (n == 1)
|
|
quitf(_ok, "single line: '%s'", compress(strAnswer).c_str());
|
|
|
|
quitf(_ok, "%d lines", n);
|
|
}
|