This repository was archived by the owner on Dec 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_maker.cpp
More file actions
63 lines (63 loc) · 1.41 KB
/
data_maker.cpp
File metadata and controls
63 lines (63 loc) · 1.41 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<windows.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
char s[110];
char tmp[120]="mkdir ";
char filename[120];
int n,a;
int flag;
int range[110];
int main()
{
cout<<"请输入题目名称(英文):"<<endl;
cin>>s;
system("g++ std.cpp -o std.exe -O2");
system("g++ maker.cpp -o maker.exe -O2");
strcat(tmp,s);
system(tmp);
cout<<"请输入测试组数:"<<endl;
cin>>n;
cout<<"请输入每组的数据范围:"<<endl;
for(int i=1;i<=n;i++)
cin>>range[i];
cout<<"是否生成空的val.cpp?(0/1)"<<endl;
cin>>a;
cout<<"是否删除垃圾文件?(0/1)"<<endl;
cin>>flag;
for(int i=1;i<=n;i++)
{
char t[120];
sprintf(t,"maker %d > %s/%s%d.in",range[i],s,s,i);
system(t);
sprintf(t,"std < %s/%s%d.in > %s/%s%d.out",s,s,i,s,s,i);
system(t);
}
if(a)
{
FILE *VAL=fopen("val.cpp","w");
fprintf(VAL,"int main()\n{\n\treturn 0;\n}");
sprintf(tmp,"copy val.cpp \"%s/\"",s);
system(tmp);
if(flag) system("del val.cpp");
}
sprintf(tmp,"copy std.cpp \"%s/\"",s);
system(tmp);
system("del std.exe");
system("del maker.exe");
if(flag)
{
system("del std.cpp");
system("del maker.cpp");
}
}