对拍程序
来源:互联网 发布:java jlabel 链接 编辑:程序博客网 时间:2024/05/16 00:51
随即数据生成 根据题目的输入格式生成
例:
#include<stdio.h>#include<string>#include<cstring>#include<queue>#include<algorithm>#include<functional>#include<vector>#include<iomanip>#include<math.h>#include<iostream>#include<sstream>#include<set>#include<ctime>using namespace std;int main(){ freopen("C://Users//hss//Documents//ACM//duipai//data.txt","w",stdout); srand(time(0)); int T=1500; while (T--) { int Cash=rand()% 100001; int N=rand()%11; cout<<Cash<<' '<<N; for (int i=0;i<N;i++) { int ni=rand()%1001; int di=rand()%1000+1; cout<<' '<<ni<<' '<<di; } cout<<endl; } return 0;}
在正确的程序和你的程序开头加入以下代码:
freopen("C://Users//hss//Documents//ACM//duipai//data.txt","r",stdin); freopen("C://Users//hss//Documents//ACM//duipai//MyOut.txt","w",stdout);
freopen("C://Users//hss//Documents//ACM//duipai//data.txt","r",stdin); freopen("C://Users//hss//Documents//ACM//duipai//MyOut2.txt","w",stdout);
之后建立duipai.txt 输入以下内容
@echo offfc MyOut.txt MyOut2.txtpause
之后扩展名改为bat
分别运行即可
0 0
- 对拍程序
- 对拍程序
- ACM对拍程序
- 对拍程序
- 对拍程序
- 对拍程序
- ACM对拍程序
- ACM对拍程序
- 程序对拍
- ACM对拍程序
- ACM对拍程序
- ACM对拍程序
- 程序对拍
- 对拍程序
- 程序对拍方法
- ACM 程序对拍
- 对拍程序
- 对拍程序
- Codeforces 14D 求树的直径(网上大多数是DFS于是自己写了个BFS)
- java之网络编程基础
- 排序算法之一 快速排序
- 采用libxml2解析xml资源
- vs2008进行移动开发WINCE时,编译慢的解决方法
- 对拍程序
- java运行时类信息--原理、API以及应用
- 实例学习ansible系列(4)常用模块之command/shell/raw
- IOS开发数据库篇—SQLite模糊查询
- 树的实现Java
- Java 设计模式之单例模式的详解(创建模式)
- NSNotification是同步还是异步?
- 经典的读者写者问题
- Spark2学习1之基本环境搭建(win)问题