?? sxformview.cpp
字號:
// SXFormView.cpp : implementation file
//
#include "stdafx.h"
#include "3d.h"
#include "SXFormView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSXFormView
IMPLEMENT_DYNCREATE(CSXFormView, CFormView)
CSXFormView::CSXFormView()
: CFormView(CSXFormView::IDD)
{
//{{AFX_DATA_INIT(CSXFormView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CSXFormView::~CSXFormView()
{
}
void CSXFormView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSXFormView)
DDX_Control(pDX, IDC_DATA, m_data);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSXFormView, CFormView)
//{{AFX_MSG_MAP(CSXFormView)
ON_BN_CLICKED(IDC_BSX, OnBsx)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSXFormView diagnostics
#ifdef _DEBUG
void CSXFormView::AssertValid() const
{
CFormView::AssertValid();
}
void CSXFormView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSXFormView message handlers
//求跨度
int FindKd(UINT m[])
{
int n1=0,n2=0,n3=0;
n1 = abs(m[0]-m[1]);
n2 = abs(m[1]-m[2]);
n3 = abs(m[2]-m[0]);
int max1=max(n1,n2);
int max2=max(n2,n3);
return max(max1,max2);
}
void CSXFormView::OnBsx()
{
// TODO: Add your control notification handler code here
m_visit.OnInit3DOther();
int nCount = 0;
int nfhCount = 0;
CString strtmp1 = "",strtmp2 = "";
/*
m_visit.m_p3dotherSet->Move(10);
int ncumvalue = 0,nkd = 0;
UINT data[] = {0,0,0};
while(!m_visit.m_p3dotherSet->IsEOF())
{
m_visit.m_p3dotherSet->MovePrev();
data[0] = m_visit.m_p3dotherSet->m_iBNo;
data[1] = m_visit.m_p3dotherSet->m_iSNo;
data[2] = m_visit.m_p3dotherSet->m_iGNo;
ncumvalue = data[0] + data[1] +data[2];
nkd = FindKd(data);
m_visit.m_p3dotherSet->MoveNext();
if(m_visit.m_p3dotherSet->m_iBNo != ((ncumvalue + nkd) % 10) && \
(m_visit.m_p3dotherSet->m_iSNo != ((ncumvalue + nkd) % 10))\
&&(m_visit.m_p3dotherSet->m_iGNo != ((ncumvalue + nkd) % 10)))
nfhCount ++;
m_visit.m_p3dotherSet->MoveNext();
nCount ++;
}
*/
/*
while(!m_visit.m_p3dotherSet->IsEOF())
{
if(m_visit.m_p3dotherSet->m_iBNo == (m_visit.m_p3dotherSet->m_iCount + 10 -3) % 10)
nfhCount ++;
m_visit.m_p3dotherSet->MoveNext();
nCount ++;
}
strtmp1.Format("符合條件的記錄共%d 條",nfhCount);
strtmp2.Format ("總記錄:%d條",nCount);
strtmp1 += strtmp2;
m_data.SetWindowText(strtmp1);
*/
m_visit.m_p3dotherSet->Move(10);
int npreB = 0;
int n1 = 0,n2 = 0,n3 = 0,n4 = 0,n5 = 0,n6 = 0,n7 = 0 ,n8 = 0,n9 = 0;
int nB[10],nS[10],nG[10];
for(int i=0;i<10;i++)
nB[i] = nS[i] = nG[i] = i;
CString str1 = "",str2 = "";
int nNum = 0;
while(!m_visit.m_p3dotherSet->IsEOF())
{
m_visit.m_p3dotherSet->MovePrev();
npreB = m_visit.m_p3dotherSet->m_iBNo; //a
n1 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo; //a+b
n2 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iGNo ; //he
n3 = npreB*3+3; //a*3+3
n4 = npreB*7+7;
n5 = m_visit.m_p3dotherSet->m_iGNo ; //c
n6 = m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iSJBNo;//b+d
n7 = m_visit.m_p3dotherSet->m_iGNo + m_visit.m_p3dotherSet->m_iSJBNo;//c+d
n8 = m_visit.m_p3dotherSet->m_iGNo + n2;//c+he
n9 = m_visit.m_p3dotherSet->m_iSJBNo; //d
str1 = "";
for(i=0;i<10;i++)
{
if((nB[i] == npreB*2%10) || (nB[i] == npreB) || (nB[i] == n1%10) || (nB[i] == n2%10)\
||(nB[i] == n3%10) || (nB[i] == n4%10) || (nB[i] == n5*2%10) || (nB[i] == (n5*3+3)%10)\
||(nB[i] == (n5*7+7)%10) || (nB[i] == n6%10) || (nB[i] == n7%10) || (nB[i] == n8%10)\
||(nB[i] == n9*2%10) || (nB[i] == (n9+n2)%10))
{
nB[i] = 99;
nNum ++; //殺號個數
}
}
m_visit.m_p3dotherSet->MoveNext();
if((m_visit.m_p3dotherSet->m_iBNo != npreB*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != npreB)\
&& (m_visit.m_p3dotherSet->m_iBNo != n1%10) \
&& (m_visit.m_p3dotherSet->m_iBNo != n2%10) \
&& (m_visit.m_p3dotherSet->m_iBNo != n3%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != n4%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != n5*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (n5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (n5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != n6%10)
&& (m_visit.m_p3dotherSet->m_iBNo != n7%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != n8%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != n9*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (n9+n2)%10)
\
\
&& (m_visit.m_p3dotherSet->m_iSNo != npreB*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != npreB)\
&& (m_visit.m_p3dotherSet->m_iSNo != n1%10) \
&& (m_visit.m_p3dotherSet->m_iSNo != n2%10) \
&& (m_visit.m_p3dotherSet->m_iSNo != n3%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != n4%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != n5*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (n5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (n5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != n6%10)
&& (m_visit.m_p3dotherSet->m_iSNo != n7%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != n8%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != n9*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (n9+n2)%10)
\
\
&& (m_visit.m_p3dotherSet->m_iGNo != npreB*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != npreB)\
&& (m_visit.m_p3dotherSet->m_iGNo != n1%10) \
&& (m_visit.m_p3dotherSet->m_iGNo != n2%10) \
&& (m_visit.m_p3dotherSet->m_iGNo != n3%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != n4%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != n5*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (n5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (n5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != n6%10)
&& (m_visit.m_p3dotherSet->m_iGNo != n7%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != n8%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != n9*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (n9+n2)%10))
{
str1 = "預測號:";
//if(nNum > 8)
{
for(i=0;i<10;i++)
{
if(nB[i] != 99)
{
str1.Format("%d",nB[i]);
str2 += str1;
}
}
str2 += "\t";
str1.Format("實際號:%d %d %d",m_visit.m_p3dotherSet->m_iBNo,m_visit.m_p3dotherSet->m_iSNo,m_visit.m_p3dotherSet->m_iGNo);
str2 += str1;
nfhCount ++;
}
str2 += "\r\n";
}
m_visit.m_p3dotherSet->MoveNext();
nCount ++;
for(i=0;i<10;i++)
nB[i] = i;
nNum = 0;
}
/*
m_visit.m_p3dotherSet->Move(20);
int npreb = 0,npres = 0,npreg = 0;
int nb1 = 0,nb2 = 0,nb3 = 0,nb4 = 0,nb5 = 0,nb6 = 0,nb7 = 0 ,nb8 = 0,nb9 = 0;
int ns1 = 0,ns2 = 0,ns3 = 0,ns4 = 0,ns5 = 0,ns6 = 0,ns7 = 0,ns8 = 0,ns9 = 0;
int ng1 = 0,ng2 = 0,ng3 = 0,ng4 = 0,ng5 = 0,ng6 = 0,ng7 = 0,ng8 = 0,ng9 = 0;
while(!m_visit.m_p3dotherSet->IsEOF())
{
m_visit.m_p3dotherSet->MovePrev();
npreb = m_visit.m_p3dotherSet->m_iBNo; //a
nb1 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo; //a+b
nb2 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iGNo ; //he
nb3 = npreb*3+3; //a*3+3
nb4 = npreb*7+7;
nb5 = m_visit.m_p3dotherSet->m_iGNo ; //c
nb6 = m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iSJBNo;//b+d
nb7 = m_visit.m_p3dotherSet->m_iGNo + m_visit.m_p3dotherSet->m_iSJBNo;//c+d
nb8 = m_visit.m_p3dotherSet->m_iGNo + nb2;//c+he
nb9 = m_visit.m_p3dotherSet->m_iSJBNo; //d
npres = m_visit.m_p3dotherSet->m_iSNo; //a
ns1 = m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iGNo; //a+b
ns2 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iGNo ; //he
ns3 = npres*3+3; //a*3+3
ns4 = npres*7+7;
ns5 = m_visit.m_p3dotherSet->m_iGNo ; //c
ns6 = m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iSJGNo;//b+d
ns7 = m_visit.m_p3dotherSet->m_iGNo + m_visit.m_p3dotherSet->m_iSJSNo;//c+d
ns8 = m_visit.m_p3dotherSet->m_iGNo + ns2;//c+he
ns9 = m_visit.m_p3dotherSet->m_iSJSNo; //d
npreg = m_visit.m_p3dotherSet->m_iGNo; //a
ng1 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iGNo; //a+b
ng2 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iGNo ; //he
ng3 = npreb*3+3; //a*3+3
ng4 = npreb*7+7;
ng5 = m_visit.m_p3dotherSet->m_iGNo ; //c
ng6 = m_visit.m_p3dotherSet->m_iBNo + m_visit.m_p3dotherSet->m_iSJGNo;//b+d
ng7 = m_visit.m_p3dotherSet->m_iSNo + m_visit.m_p3dotherSet->m_iSJBNo;//c+d
ng8 = m_visit.m_p3dotherSet->m_iGNo + ng2;//c+he
ng9 = m_visit.m_p3dotherSet->m_iSJGNo; //d
m_visit.m_p3dotherSet->MoveNext();
if((m_visit.m_p3dotherSet->m_iBNo != npreb*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != npreb)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb1%10) \
&& (m_visit.m_p3dotherSet->m_iBNo != nb2%10) \
&& (m_visit.m_p3dotherSet->m_iBNo != nb3%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb4%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb5*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (nb5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (nb5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb6%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb7%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb8%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != nb9*2%10)\
&& (m_visit.m_p3dotherSet->m_iBNo != (nb9+nb2)%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != npres*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != npres)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns1%10) \
&& (m_visit.m_p3dotherSet->m_iSNo != ns2%10) \
&& (m_visit.m_p3dotherSet->m_iSNo != ns3%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns4%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns5*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (ns5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (ns5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns6%10)
&& (m_visit.m_p3dotherSet->m_iSNo != ns7%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns8%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != ns9*2%10)\
&& (m_visit.m_p3dotherSet->m_iSNo != (ns9+ns2)%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != npreg*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != npreg)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng1%10) \
&& (m_visit.m_p3dotherSet->m_iGNo != ng2%10) \
&& (m_visit.m_p3dotherSet->m_iGNo != ng3%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng4%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng5*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (ng5*3+3)%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (ng5*7+7)%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng6%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng7%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != ng8%10)
&& (m_visit.m_p3dotherSet->m_iGNo != ng9*2%10)\
&& (m_visit.m_p3dotherSet->m_iGNo != (ng9+ng2)%10))
nfhCount ++;
m_visit.m_p3dotherSet->MoveNext();
nCount ++;
}
strtmp1.Format("符合條件的記錄共%d 條",nfhCount);
strtmp2.Format ("總記錄:%d條",nCount);
strtmp1 += strtmp2;
m_data.SetWindowText(strtmp1);
*/
/*
UINT mdata[3] = {0,0,0};
m_visit.m_p3dotherSet->Move(10);
UINT a1 = 0,a2 = 0;
while(!m_visit.m_p3dotherSet->IsEOF())
{
m_visit.m_p3dotherSet->MovePrev();
m_visit.m_p3dotherSet->MovePrev();
m_visit.m_p3dotherSet->MovePrev();
a1 = m_visit.m_p3dotherSet->m_iSJGNo;
m_visit.m_p3dotherSet->MoveNext();
m_visit.m_p3dotherSet->MoveNext();
m_visit.m_p3dotherSet->MoveNext();
a2 = m_visit.m_p3dotherSet->m_iGNo;
if(a1 == a2)
nfhCount ++;
m_visit.m_p3dotherSet->MoveNext();
nCount ++;
}
*/
strtmp1.Format("符合條件的記錄共%d 條",nfhCount);
strtmp2.Format ("總記錄:%d條",nCount);
strtmp1 += strtmp2;
strtmp1 += "\r\n";
strtmp1 += str2;
m_data.SetWindowText(strtmp1);
m_visit.OnClose3DOther();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -