-
Notifications
You must be signed in to change notification settings - Fork 18
制作输入输出文件
luosw edited this page Aug 5, 2020
·
12 revisions
下面的操作都是要包含头文件 caryon.h,注意,在程序的目录文件夹也可以包含头文件经过编译后产生的 caryon.h.gch 文件,来使用数据生成器。
打开 std.cpp,看向这个程序段:
makein(1,10){
csh();
xxxxx;
}这个操作是用来生成文件:1.in-10.in的,可以自由更改makein的两个参数进行替换。例如makein(3,5)就是生成3.in-5.in。
当我们执行完test.cpp后就会发现根目录多出来了一个文件夹,里面有1.in~10.in的文件,这就是制造的结果。
这里需要注意,csh() 函数不可删去,否则会出现一些未知问题。
下面这个:
dataname="";这个是填写前缀的,例如下面的程序:
#include"caryon.h"
using namespace std;
using namespace ca;
int main(){
dataname="chen_zhe-ak-ioi";
makein(1,10){
csh();
xxx;
}
}就会在根目录里面的文件夹data-chen_zhe-ak-ioi中生成chen_zhe-ak-ioi1.in~chen_zhe-ak-ioi10.in了。
注意,由于新版本原因,dataname字段内不可以出现空格!!!
在我们的所有东西搞完后,记得使用
closefile();函数来释放内存空间。(效果类似于fclose,可以不写)
我们已经学会去制造in文件了,怎么创造对应的out文件呢?我们把之前的样例丰富一下:
#include"caryon.h"
using namespace std;
using namespace ca;
int main(){
dataname="chen_zhe-ak-ioi";
makein(1,10){
csh();
xxx;
}
makeout(1,10);
}此时,在test.cpp所在的目录里面必须有std.exe文件,也就是俗称的标准程序。注意一定是标准程序经过编译后的 std.exe文件,才能制造出对应的out文件。
CarYon is made by luosw, licensed under ISC Lincense.
Sorry, there was an error rendering this page.