当前位置: 首页 > news >正文

自动化测大样例

省流:

for((i=1;i<=10;i++))
do
g++ T1.cpp -std=c++14 -Wall -Wextra -O a.exe
cp ex_edit$i.in edit.in
./a.exe
diff -s -Z ex_edit$i.ans edit.out
done
#include<bits/stdc++.h>
#include <unistd.h>
using namespace std;string filename="kamen",codename="T1";
string input1,input2,output1,output2;
void init();signed main()
{init();// exit(0);for(int i=0,nw=1;i<=100;i++,nw++){if(access((input1+to_string(i)+input2).c_str(),F_OK)==0){nw=system(("cp "+input1+to_string(i)+input2+" "+filename+".in").c_str());nw=system(("g++ "+codename+".cpp -std=c++14 -w -O2 -o run_exe.exe").c_str());nw=system("./run_exe.exe");nw=system(("diff -s -Z "+filename+".out "+output1+to_string(i)+output2).c_str());nw=system("rm run_exe.exe");}}// system("rm .fuse_hidden*");return 0;
}void init()
{if(access((filename+"1.in").c_str(),F_OK)==0) { input1=filename; input2=".in"; }if(access(("ex_"+filename+"1.in").c_str(),F_OK)==0) { input1="ex_"+filename; input2=".in"; }if(access(("ex"+filename+"1.in").c_str(),F_OK)==0) { input1="ex"+filename; input2=".in"; }if(access((filename+"1.out").c_str(),F_OK)==0) { output1=filename; output2=".out"; }if(access(("ex_"+filename+"1.out").c_str(),F_OK)==0) { output1="ex_"+filename; output2=".out"; }if(access(("ex"+filename+"1.out").c_str(),F_OK)==0) { output1="ex"+filename; output2=".out"; }if(access((filename+"1.ans").c_str(),F_OK)==0) { output1=filename; output2=".ans"; }if(access(("ex_"+filename+"1.ans").c_str(),F_OK)==0) { output1="ex_"+filename; output2=".ans"; }if(access(("ex"+filename+"1.ans").c_str(),F_OK)==0) { output1="ex"+filename; output2=".ans"; }
}
http://www.jsqmd.com/news/41935/

相关文章:

  • [Debug记录] 分布式实验-FTP编程
  • 2025年当下行业内知名的旧房翻新企业排名与推荐
  • 2025年国内旧房翻新公司综合实力排行榜TOP10推荐
  • 现今国内口碑好的旧房翻新企业排行
  • Linux服务器编程实践60-双向管道:socketpair函数的完成与应用场景
  • 前端从0到1实战】第3篇:拒绝插件,手写一个原生模态弹窗 (Modal)
  • 20232413 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • 循环数组下一个更大元素:从错误到精通(含2种解法+同类型扩展)
  • 实验四运行结果
  • 随机化数论算法总结
  • 20232422 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • 完整教程:【数据迁移】HBase Bulkload批量加载原理
  • 【AI智能体开发】什么是LLM?如何在本地搭建属于自己的Ai智能体? - 详解
  • 20232422 龙浩然 2025-2026-1 《网络与系统攻防技术》实验五实验报告
  • DL 1 深度学习简介 张量tensor操作
  • Spring Cloud Alibaba + RocketMQ
  • bpftrace报错:definitions.h:17:3: error: unknown type name pid_t
  • mybatis_generator
  • 目前市场口碑好的平移门服务商
  • [AGC030F]Permutation and Minimum
  • 2025年安徽伸缩门公司哪家权威:十大品牌综合评测
  • 脑机接口
  • 2025年11月阜阳伸缩门供应厂家有哪些
  • 【案例实战】多维度视角:鸿蒙2048游戏开发的深度分析与感悟 - 详解
  • 2025跨境物流/运输公司推荐:中亚/俄罗斯/阿富汗等线路最新top5口碑推荐
  • 2025年11月智能床垫品牌TOP5推荐:服务器系统软件办公深度集成
  • 2025年11月载冷剂厂家榜单:性能价格服务综合对比
  • Spring 中的 @Configuration 注解
  • PLUG2:STM32启动流程 - LI,Yi
  • C# 封装、继承、抽象、接口