-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.cpp
36 lines (26 loc) · 877 Bytes
/
create.cpp
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
#include "cmd_tools.h"
#include <cassert>
#include <filesystem>
using namespace std;
int main(int argc, char *argv[]) {
assert(argc == 2);
command_line_tool cmd;
string problem_id(argv[1]);
string problem_root = "problem_" + problem_id;
string problem_cpp = problem_root + "/" + problem_id + ".cpp";
string problem_in = problem_root + "/" + problem_id + ".in";
//string problem_info = problem_root + "/" + "info.json";
if (!filesystem::exists(problem_root)) {
cmd.execute("mkdir", problem_root);
}
if (!filesystem::exists(problem_cpp)) {
cmd.execute("cp", "~/code/programming-contest-codes/template.cpp", problem_cpp);
}
if (!filesystem::exists(problem_in)) {
cmd.execute("touch", problem_in);
}
// if (!filesystem::exists(problem_info)) {
// cmd.execute("cp", "~/code/programming-contest-codes/_info.json", problem_info);
// }
return 0;
}