⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 体彩dlg.cpp

📁 一个彩民的神器
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// 体彩Dlg.cpp : implementation file
//

#include "stdafx.h"
#include "体彩.h"
#include "体彩Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog

CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMyDlg::IDD, pParent)
{
counter=0;
	getdata=false;
	good=false;
	//{{AFX_DATA_INIT(CMyDlg)
	m_2 = 0;
	m_1 = 0;
	m_3 = 0;
	m_4 = 0;
	m_5 = 0;
	m_6 = 0;
	m_7 = 0;
	m_date = 0;
	m_predata = _T("");
	m_randdata = _T("==>");
	m_teststring = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMyDlg)
	DDX_Control(pDX, IDC_LIST1, m_list);
	DDX_Text(pDX, IDC_2, m_2);
	DDV_MinMaxInt(pDX, m_2, 0, 9);
	DDX_Text(pDX, IDC_1, m_1);
	DDV_MinMaxInt(pDX, m_1, 0, 6);
	DDX_Text(pDX, IDC_3, m_3);
	DDV_MinMaxInt(pDX, m_3, 0, 9);
	DDX_Text(pDX, IDC_4, m_4);
	DDV_MinMaxInt(pDX, m_4, 0, 9);
	DDX_Text(pDX, IDC_5, m_5);
	DDV_MinMaxInt(pDX, m_5, 0, 9);
	DDX_Text(pDX, IDC_6, m_6);
	DDV_MinMaxInt(pDX, m_6, 0, 9);
	DDX_Text(pDX, IDC_7, m_7);
	DDV_MinMaxInt(pDX, m_7, 0, 9);
	DDX_Text(pDX, IDC_date, m_date);
	DDX_Text(pDX, IDC_randdata, m_randdata);
	DDX_Text(pDX, IDC_teststring, m_teststring);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
	//{{AFX_MSG_MAP(CMyDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_testb, Ontestb)
	ON_BN_CLICKED(IDC_randb, Onrandb)
	ON_BN_CLICKED(IDC_nowb, Onnowb)
	ON_BN_CLICKED(IDC_indata, Onindata)
	ON_BN_CLICKED(IDC_fenxidata, Onfenxidata)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDC_lastb, Onlastb)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers

BOOL CMyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	srand(time(NULL));
	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	m_list.InsertColumn(0,"第几期");
	m_list.SetColumnWidth(0,60);
	m_list.InsertColumn(1,"一");
	m_list.SetColumnWidth(1,30);
	m_list.InsertColumn(2,"二");
	m_list.SetColumnWidth(2,30);
	m_list.InsertColumn(3,"三");
	m_list.SetColumnWidth(3,30);
	m_list.InsertColumn(4,"四|");
	m_list.SetColumnWidth(4,30);
	m_list.InsertColumn(5,"|五");
	m_list.SetColumnWidth(5,30);
	m_list.InsertColumn(6,"六");
	m_list.SetColumnWidth(6,30);
	m_list.InsertColumn(7,"七");
	m_list.SetColumnWidth(7,30);
	
int i=0;
	///////////
readdata();
CString string;
pos=caipiaolist.GetHeadPosition();
while(pos!=caipiaolist.GetTailPosition())
{
Cmoney *money=(caipiaolist.GetAt(pos));
string.Format("%d",money->m_date);
m_list.InsertItem(i,string);
string.Format("%d",money->m_1);
m_list.SetItemText(i,1,string);
string.Format("%d",money->m_2);
m_list.SetItemText(i,2,string);
string.Format("%d",money->m_3);
m_list.SetItemText(i,3,string);
string.Format("%d",money->m_4);
m_list.SetItemText(i,4,string);
string.Format("%d",money->m_5);
m_list.SetItemText(i,5,string);
string.Format("%d",money->m_6);
m_list.SetItemText(i,6,string);
string.Format("%d",money->m_7);
m_list.SetItemText(i,7,string);
i++;
caipiaolist.GetNext(pos);
}
	///////
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialog::OnSysCommand(nID, lParam);
	}
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CMyDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CMyDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CMyDlg::Ontestb() 
{
	m_teststring="当前随机数为:        ";
m_teststring+=m_randdata;
pos=caipiaolist.GetHeadPosition();
int agindata[7]={0,0,0,0,0,0,0};
Cmoney *money=(caipiaolist.GetAt(pos));
again(agindata,randcur.m_1);
again(agindata,randcur.m_2);
again(agindata,randcur.m_3);
again(agindata,randcur.m_4);
again(agindata,randcur.m_5);
again(agindata,randcur.m_6);
again(agindata,randcur.m_7);
int lianhao=0;
test(lianhao);
CString str;
bool t[7];
for(int j=0;j<7;j++)
t[j]=false;
if(lianhao>0&&lianhao<3)
{
str.Format("   ==>本随机数据有%d对重号,好",lianhao);
t[0]=true;
}
else
str.Format("   ==>本随机数据有%d对重号,差",lianhao);
m_teststring+=str;
int counter=0;
for( j=0;j<7;j++)
{
counter+=agindata[j];
}

if(counter<2||counter>4)
{
str.Format("                  ==>与上一期重号太多太少为%d 差",counter);
}
else{
str.Format("                  ==>与上一期重号较为适合为%d 好",counter);
t[1]=true;
}
m_teststring+=str;
int smalldata=0;
int bigdata=0;
if(randcur.m_1<5)
smalldata++;
else
bigdata++;
if(randcur.m_2<5)
smalldata++;
else
bigdata++;
if(randcur.m_3<5)
smalldata++;
else
bigdata++;
if(randcur.m_4<5)
smalldata++;
else
bigdata++;
if(randcur.m_5<5)
smalldata++;
else
bigdata++;
if(randcur.m_6<5)
smalldata++;
else
bigdata++;
if(randcur.m_7<5)
smalldata++;
else
bigdata++;
if(bigdata<=5&&bigdata>=2){
str.Format("              ==>大号为%d,小号为%d:好",bigdata,smalldata);
t[2]=true;
}
else
str.Format("              ==>大号为%d,小号为%d:差",bigdata,smalldata);

m_teststring+=str;
int c=0;
while(pos!=caipiaolist.GetTailPosition())
{
money=(caipiaolist.GetAt(pos));
if(money->m_1==randcur.m_1&&money->m_2==randcur.m_2&&money->m_3==randcur.m_3&&money->m_4==randcur.m_4
&&money->m_5==randcur.m_5&&money->m_6==randcur.m_6&&money->m_7==randcur.m_7)
{
m_teststring+="  ==>与以往开奖号相同,差";
c=1;
break;
}
caipiaolist.GetNext(pos);
}
if(c==0){
m_teststring+="  ==>与以往开奖号不同,好";
t[3]=true;
}
int jishu=0;
int oushu=0;
if(randcur.m_1%2==0)
oushu++;
else
jishu++;
if(randcur.m_2%2==0)
oushu++;
else
jishu++;
if(randcur.m_3%2==0)
oushu++;
else
jishu++;
if(randcur.m_4%2==0)
oushu++;
else
jishu++;
if(randcur.m_5%2==0)
oushu++;
else
jishu++;
if(randcur.m_6%2==0)
oushu++;
else
jishu++;
if(randcur.m_7%2==0)
oushu++;
else
jishu++;
if(oushu>=2&&oushu<=5){
str.Format("==>偶数为%d,奇数为%d,好",oushu,jishu);
t[4]=true;
}
else
str.Format("==>偶数为%d,奇数为%d,差",oushu,jishu);
m_teststring+=str;
lianhao=0;
money=&randcur;
if(money->m_1+1==money->m_2||money->m_1-1==money->m_2)
lianhao++;
if(money->m_2+1==money->m_3||money->m_2-1==money->m_3)
lianhao++;
if(money->m_3+1==money->m_4||money->m_3-1==money->m_4)
lianhao++;
if(money->m_4+1==money->m_5||money->m_4-1==money->m_5)
lianhao++;
if(money->m_5+1==money->m_6||money->m_5-1==money->m_6)
lianhao++;
if(money->m_6+1==money->m_7||money->m_6-1==money->m_7)
lianhao++;
if(lianhao==0){
str.Format("  ==>连号为%d,好",lianhao);
t[5]=true;
}
if(lianhao==1){
str.Format("  ==>连号为%d,最好",lianhao);
t[5]=true;

}
if(lianhao==2){
str.Format("  ==>连号为%d,一般",lianhao);
t[5]=true;
}
if(lianhao>2)
str.Format("  ==>连号为%d,差",lianhao);
m_teststring+=str;
if(randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7<=39&&randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7>=18)
{
if(randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7<=35&&randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7>=24){
str.Format("      ==>总和为%d,最好",randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7);
t[6]=true;
}
else{
str.Format("      ==>总和为%d,好",randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7);
t[6]=true;
}
}
else
str.Format("      ==>总和为%d,差",randcur.m_1+randcur.m_2+randcur.m_3+randcur.m_4+randcur.m_5
+randcur.m_6+randcur.m_7);
m_teststring+=str;
int rehao[10]={0,0,0,0,0,0,0,0,0,0};
pos=caipiaolist.GetHeadPosition();
for(int u=0;u<15;u++)
{
money=(caipiaolist.GetAt(pos));

for(int s=0;s<10;s++){
if(money->m_1==s)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -