http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用。但是如果离开了MFC框架,还有没有这样使用起...
分类:
编程语言 时间:
2014-11-10 11:21:12
阅读次数:
367
.GBK ---> UTF-8 void ConvertGBKToUtf8(CString& strGBK) { int len = MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)strGBK, -1, NULL, 0); WCHAR *wszUtf8 = ne.....
分类:
其他好文 时间:
2014-11-09 15:09:08
阅读次数:
181
一:实现之前先说一所find_first_of姊妹函数
(1)find_first_of(string &str, size_type index = 0):
查找在字符串中第一个与str中的某个字符匹配的字符,返回它的位置。搜索从index正向开始,如果没找到就返回string::npos
(2) find_first_not_of(cstring &str, size_typ...
分类:
编程语言 时间:
2014-11-08 22:11:35
阅读次数:
221
思路:
正难则反
//C(M+N,M)*C(Q+M-P,Q)-C(N+M-P,N)*C(M+Q,M);
代码:
#include"cstdlib"
#include"cstdio"
#include"cstring"
#include"cmath"
#include"stack"
#include"algorithm"
#include"iostream"
using namespace...
分类:
其他好文 时间:
2014-11-08 16:51:23
阅读次数:
164
把动态bmp24转换为avi
BYTE tmp_buf[1024*768*4];
//生成avi
void BMPtoAVI(CString szAVIName, CString strBmpDir)
{
CFileFind finder;
strBmpDir += _T("\\*.bmp");
AVIFileInit();
AVISTREAMINFO strhdr;
PAVIFIL...
分类:
其他好文 时间:
2014-11-07 17:12:14
阅读次数:
186
//得到程序的路径(strTemp就是当前项目中.exe的所在目录)
CString sPath, strTemp;
GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
sPath.ReleaseBuffer();
int nPos = sPath.ReverseFind('\\');
strTe...
分类:
编程语言 时间:
2014-11-06 17:45:26
阅读次数:
152
题目:hdoj 2586 How far away ?
题意:给出一个有权树,求任意两点的之间的距离。
分析:思想就是以一个点 root 作为跟变成有根数,然后深搜处理处所有点到跟的距离。求要求的两个点的LCA(最近公共祖先),
然后ans = dis【x】 + dis【y】 - 2 * dis【LCA(x,y)】,可以画图分析一下就知道。
求LCA我用的是Tarj...
分类:
其他好文 时间:
2014-11-06 11:01:48
阅读次数:
181
1.添加static text ,ID为IDC_ShowTime
2,在OnInitDialog()中
SetTimer(1,1000,NULL); //启动定时器
3.添加WM_TIMER消息处理函数,ontimer中添加如下代码:
CString strTime;
CTime tm;
tm=CTime:...
分类:
编程语言 时间:
2014-11-06 09:25:15
阅读次数:
219
题意:
中文题目!
思路:
首先 M^k可以分解成 (M^(k*p)) p是素数
这么我们只要枚举素因子就好了
由于数据 所以只要枚举60以内的素数就够了
然后因为2*3*5*7就超过60了 做容斥原理就最多就只有三次
代码:
#include"cstdlib"
#include"cstdio"
#include"cstring"
#include"cmath"
#include"...
分类:
其他好文 时间:
2014-11-06 09:23:11
阅读次数:
158
CString GetMidStr(CString str,CString strL,CString strR){ CString strs; int len; int len2; len = str.Find(strL) + strL.GetLength(); len2 = str.Find(st...
分类:
其他好文 时间:
2014-11-05 14:20:22
阅读次数:
177