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

📄 historyreorcd.cpp

📁 根据双色球历史开奖记录,用GA(遗传算法)推算下期开奖号码.主要是用于学习遗传算法,推算下期开奖号码只是一个乐趣.并不能真正的正确.
💻 CPP
字号:
// HistoryReorcd.cpp: implementation of the CHistoryReorcd class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ShuangSeQiu.h"
#include "HistoryReorcd.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CHistoryReorcd::CHistoryReorcd()
{

}

CHistoryReorcd::~CHistoryReorcd()
{

}


//返回文件当前行的内容
CString CHistoryReorcd::GetLineActionFile(CString filename, int line)
{
	CString str ;

	CStdioFile myfile;
	if(!myfile.Open(filename,CFile::modeRead))
	{
		myfile.Open(filename,CFile::modeWrite|CFile::modeCreate);

	}
	
	int curline =1;
	
	while(curline <= line){
        myfile.ReadString(str);
		curline++;
    }
	myfile.Close();

	return str;
}

//返回文件行数
int CHistoryReorcd::GetFileLine(CString filename)
{
	int line =0;

	CStdioFile myfile;
	if(!myfile.Open(filename,CFile::modeReadWrite))
		myfile.Open(filename,CFile::modeWrite|CFile::modeCreate);

	CString str ;
	myfile.ReadString(str);
	
	while(str.GetLength() >=10 ){
        myfile.ReadString(str);
		line++;
    }
	myfile.Close();

	return line;
}

CString CHistoryReorcd::GetCurPath()
{
	TCHAR   cPath[_MAX_PATH];  
    GetCurrentDirectory(MAX_PATH, cPath);
    CString strPath = cPath;
    strPath.TrimRight("\\");
	return strPath;
}

⌨️ 快捷键说明

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