Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <string>
- #include <cstring>
- using namespace std;
- int main()
- {
- bool same = true;
- int i = 0;
- while (same)
- {
- stringstream ss;
- ss << i;
- string seed = ss.str();
- system(("gen.exe " + seed + "> test.in").c_str());
- system("good.exe < test.in > out1.out"); //system("./good < test.in > out1");
- system("mine.exe < test.in > out2.out"); //system("./mine < test.in > out1");
- ifstream cin1("out1");
- ifstream cin2("out2");
- string A,B;
- while (getline(cin1,A))
- {
- getline(cin2,B);
- if (A != B)
- {
- same = false;
- break;
- }
- }
- if (same)
- {
- cout << ++i << ". OK!\n";
- }
- else
- {
- ifstream cin3("test.in");
- string X;
- while (getline(cin3,X)) cout << X << "\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement