使用Python的cyaron造数据

使用洛谷的cyaron项目 介绍
在github上的项目地址链接
使用下面的代码造了三组a+b的数据
import cyaron

import numpy
for i in range(1,4):
    test_data = cyaron.IO(file_prefix="D:\setproblem\data",data_id=i,input_suffix=".in", output_suffix=".out")
	#路径之中不要包含其他字符,只包含英文字母
    a=numpy.random.randint(0,100)
    b=numpy.random.randint(0,100)
    test_data.input_writeln(a,b)
    test_data.output_gen("D:\setproblem\A.exe")
    #填上标程编译之后的可执行文件.exe的地址

我把效果贴一下,代码中的意思就可想而知了,下面的A.exe是a+b.cpp编译后的可执行文件,因为路径中不能出现除了英文字符以外的字符,所以就改了

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43311695/article/details/107286470