📄 selectalott.cpp
字号:
#include "StdAfx.h"
#include "iostream.h"
#include "iomanip.h"
#include "fstream.h"
#include "strstrea.h"
#include "CheckPast.h"
#include "CheckPast.h"
#include "CheckNew.h"
#include "SelectALott.h"
int Select(int N)
{
for(int kk=0;kk<N;kk++)
{
Sleep(1000);
CString FileName;
bool NumOK;
int flag[10];
FileName="PastData.txt";
FILE *fp,*fp2;
fp=fopen("新号码技术统计.txt","a+");
fp2=fopen("生成的新号码.txt","a+");
CCheckPast *Old;
Old=new CCheckPast;
// CLottaryStruct *NewA;
// NewA= new CLottaryStruct[N];
CCheckNew *NewB;
NewB=new CCheckNew;
Old->CheckData(NUM_PAST,FileName);
NumOK=FALSE;
for(int i=0;i<10;i++)
{
flag[i]=0;
}
while(NumOK==FALSE)
{
NewB->GetNewLottary();
NumOK=TRUE;
flag[0]=NewB->SetSum(89,140);
// flag[1]=NewB->SetRedOdd(4);
// flag[2]=NewB->SetAllOdd(5);
// flag[5]=Old->CheckSum(NUM_PAST,NewB->NewLott.nAllSum);
flag[7]=Old->CheckSame(NewB->NewLott.RedBall,10);
// flag[6]=Old->CheckAllAverage(10,int(NewB->NewLott.AllAverage));
// flag[8]=Old->CheckIntervals(100,NewB->NewLott.intervals);
if((flag[0]+flag[1]+flag[2]+flag[5]+flag[6]+flag[7]+flag[8]+flag[9]==0)) NumOK=TRUE;
else NumOK=FALSE;
}
//NewB->SetAllAverage();
//NewB->SetIntervals();
//NewB->SetNumIn4Zone();
//NewB->SetOdd();
fprintf(fp2,"%d %d %d %d %d %d %d\n",NewB->NewLott.RedBall[0],NewB->NewLott.RedBall[1],
NewB->NewLott.RedBall[2],NewB->NewLott.RedBall[3],NewB->NewLott.RedBall[4],NewB->NewLott.RedBall[5],NewB->NewLott.BlueBall[0]);
fprintf(fp,"%d %d %d %d %d %d %d\n",NewB->NewLott.RedBall[0],NewB->NewLott.RedBall[1],
NewB->NewLott.RedBall[2],NewB->NewLott.RedBall[3],NewB->NewLott.RedBall[4],NewB->NewLott.RedBall[5],NewB->NewLott.BlueBall[0]);
fprintf(fp,"红球总和=%d,总和=%d,红球平均=%f,总平均=%f,红球奇偶比=%d:%d,总奇偶比=%d:%d,间隔%d %d %d %d %d 四个区 %d,%d,%d,%d \n",
NewB->NewLott.nRedSum,NewB->NewLott.nAllSum,NewB->NewLott.RedAverage,NewB->NewLott.AllAverage,NewB->NewLott.nRedOdd,NewB->NewLott.nRedEven,NewB->NewLott.nAllOdd,NewB->NewLott.nAllEven,NewB->NewLott.intervals[0],NewB->NewLott.intervals[1],NewB->NewLott.intervals[2],NewB->NewLott.intervals[3],NewB->NewLott.intervals[4],
NewB->NewLott.numIn4Zone[0],NewB->NewLott.numIn4Zone[1],NewB->NewLott.numIn4Zone[2],NewB->NewLott.numIn4Zone[3]);
/*
CString a;
a.Format("筛选中的彩票是:%d, %d, %d, %d, %d, %d,%4d",
NewB->NewLott.RedBall[0], NewB->NewLott.RedBall[1],NewB->NewLott.RedBall[2], NewB->NewLott.RedBall[3],
NewB->NewLott.RedBall[4], NewB->NewLott.RedBall[5],NewB->NewLott.BlueBall[0]);
AfxMessageBox(a);
*/
fclose(fp);
fclose(fp2);
//delete NewA;
delete NewB;
delete Old;
}
return(0);
}
int StatPast(int N,char* FileName)
{
FileName="PastData.txt";
CCheckPast *Old;
Old=new CCheckPast;
// CLottaryStruct *NewA;
// NewA= new CLottaryStruct[N];
Old->CheckData(N,FileName);
return(0);
}
int StatNew(int N,char* FileName)
{
FileName="生成的新号码.txt";
CCheckNew *New;
New=new CCheckNew;
New->CheckData(N,FileName);
return(0);
AfxMessageBox("新号码分析结束!!");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -