对拍

来源:互联网 发布:java maven 非web项目 编辑:程序博客网 时间:2024/04/25 12:50
#include<cstdlib>
x=rand();//生成一个随机数,windows下0<=x<=32767.
x=rand()*rand()+rand();//int
x=rand()%n;//生成0..n-1随机数
srand(20000329);//在最前面,埋随机种子
srand(time(0));//对拍的种子,time()#include<ctime>
exit(0);//halt;
#include<cstring>
memset(a,x,sizeof a);//x=0,-1全部成为0,-1
//原理:二进制每一字节赋值
//x=127,2.13e9
//x=63,1.03e9
memcpy(a,b,sizeof a);//数组整体赋值(也可用结构体)
#include<ctime>
time(0);
(double)clock()>0.95*(double)CLOCKS_PER_SEC;//卡时工具,clock(),CLOCKS_PER_SEC均为整数,举例卡1s
#include<algorithm>
sort();
max();min();
不要用的变量名:free,j1,y1,time,next,prev,text...

:loop
std.exe
wa.exe
fc ac.out wa.out
if errorlevel 1 pause
gen.exe
goto loop
0 0