Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int numTest;
- string Convert(int num) {
- string ans = "";
- while (num > 0) ans += (char) ('0' + num%10), num /= 10;
- reverse(ans.begin(), ans.end());
- if (ans.length() == 1) ans = "00" + ans;
- else if (ans.length() == 2) ans = "0" + ans;
- return ans;
- }
- void Lets_gen() {
- ofstream GEN("input.txt", ofstream::out);
- int n = rand() % (int) 1e5 + 1;
- GEN << n << '\n';
- for (int i = 1; i <= n; ++i) GEN << rand() % (int) 1e9 + 1 << " ";
- GEN.close();
- }
- int main() {
- srand(time(NULL));
- cout << "NumTest : ";
- cin >> numTest;
- for (int T = 1; T <= numTest; ++T) {
- // system( "gen.exe" );
- Lets_gen();
- system( "prob.exe" );
- string ID = Convert(T);
- string INP = "input" + ID + ".txt";
- string OUT = "output" + ID + ".txt";
- system( ("ren input.txt " + INP).c_str() );
- system( ("ren output.txt " + OUT).c_str() );
- system( ("move " + INP + " input").c_str() );
- system( ("move " + OUT + " output").c_str() );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement