-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgentestcase.cpp
More file actions
36 lines (33 loc) · 879 Bytes
/
Copy pathgentestcase.cpp
File metadata and controls
36 lines (33 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Dev: Autoratch
#include <bits/stdc++.h>
using namespace std;
void print(string s)
{
char c[s.length()+1];
for(int i = 0;i < s.length();i++) c[i] = s[i];
c[s.length()] = '\0';
system(c);
}
int main()
{
cout << "Welcome to CPP-Grader Testcase Generator\n";
cout << "Testcase will be in form of x.in and x.sol\n";
cout << "Testcase random generator code will be testgen.cpp\n";
string solname;
int st,en;
cout << "Solname: ";
cin >> solname;
cout << "Id of test: \n From: ";
cin >> st;
cout << " To: ";
cin >> en;
print("g++ "+solname+" -o code");
for(int i = st;i <= en;i++)
{
string s = "";
int tmp = i;
while(tmp) s = (char)(tmp%10+'0')+s,tmp/=10;
print("g++ testgen.cpp -o testgen && ./testgen > "+s+".in");
print("./code < "+s+".in > "+s+".sol");
}
}