- 博客(15)
- 资源 (2)
- 收藏
- 关注
原创 LeetCode OJ——Median of Two Sorted Arrays
题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).代码:class Solution {publi
2015-11-29 19:09:50 337
原创 LeetCodeOJ——Word Search
题目: Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically
2015-11-29 16:54:46 315
原创 VS2013连接mysql数据库
步骤:1 先安装mysql数据库。2 在项目-》属性-》VC++目录-》包含目录 下添加mysql配置文件下的include文件夹路径,例:D:\XXX\mysql\include3 在项目-》属性-》VC++目录-》库目录 下添加mysql配置文件的lib文件夹路径,例: D:\XXX\mysql\lib4 拷贝mysq的llib文件夹下的libmysql.dll到mfc工程的下的debug文件
2015-11-27 16:35:59 947
原创 MFC对话框修改背景颜色或添加背景图片、控件背景与字体颜色的修改
MFC对话框修改背景颜色:在CXXXDlg::OnInitDialog()中添加: CDialogEx::SetBackgroundColor(RGB(155,170,190)); 效果如下:MFC对话框添加背景图片:在CXXXDlg::OnInitDialog()中添加:CDialogEx::SetBackgroundImage(IDB_BITMAP1);效果如下: MFC控件与背景保持
2015-11-26 20:07:05 10072 1
原创 VS2013下的CButtonST的使用
步骤:先下载CButtonST库,基于CButtonST工作与vc6环境下,于是找到一版据说可以在vs2010下运行的代码(评论都说可以),下载地址: http://download.csdn.net/detail/chengdongyuan/7634501#comment按网上教程先将四个文件复制到工程下,然后在vs2013中添加现有项将#include "BtnST.h" 加入到stdaf
2015-11-25 22:07:56 3184
原创 修改基于formView的MFC单文档背景颜色
方法: (1)先调出BOOL CXXXView::OnEraseBkgnd(CDC* pDC)函数。刚开始从类向导的虚函数中搜索OnEraseBkgnd,发现怎么也找不到(不知道是不是只有我一人这样,o(╯□╰)o。。。)后来百度到: http://jingyan.baidu.com/album/19192ad839a862e53e5707ce.html,于是试着找消息WM_ERASEBKGND
2015-11-24 20:22:34 2914
原创 去掉基于FormView的MFC单文档默认菜单和工具栏的方法
操作: (1):参考http://blog.csdn.net/clever101/article/details/5394535第二种方法,首先在MainFrm.h末尾中增加DelAllMenu函数。 (2):然后在MainFrm.cpp的OnCreate()中将下面代码注释掉,如下:/*if (!m_wndMenuBar.Create(this)) { TRACE0("
2015-11-24 17:55:55 1421
原创 LeetCode OJ——Submission Details
题目:Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure. Assume that the total area
2015-11-22 21:54:13 367
原创 LeetCode OJ——Isomorphic Strings
题目: 代码:class Solution {public: bool isIsomorphic(string s, string t) { map<char, char> t_s, s_t; for(unsigned int i=0; i<s.length(); i++) { if(t_s.count(t[i])
2015-11-22 19:46:53 373
原创 LeetCode OJ——Generate Parentheses
题目: 代码:class Solution {public: vector<string> generateParenthesis(int n) { vector<string> vec; string s; fun(vec, s, n, n); return vec; } bool fun(vector<st
2015-11-22 15:30:19 343
原创 LeetCode OJ ——Find Minimum in Rotated Sorted Array
题目: 代码:class Solution {public: int findMin(vector<int>& nums) { int left, right, medium; left = 1; //区间下标从1~nums.size() right = nums.size(); medium = (nums.size(
2015-11-22 15:06:32 295
原创 LeetCode OJ: Remove Linked List Elements
题目: 代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListN
2015-11-19 11:27:08 590
原创 LeetCode OJ:Group Anagrams
题目: 我的代码:class Solution {public: vector<vector<string>> groupAnagrams(vector<string>& strs) { vector<string> list; vector<vector<string>> group_list; vector<string>::size_t
2015-11-03 19:38:05 393
原创 Leet Code OJ: Valid Number
题目: 补充:true: .1 3. 46.e3 +.8 false: .e1 0e 0.e我的代码class Solution {public: bool isNumber(string s) { //去除首尾空格 size_t first_i = 0, last_i = s.length(); whil
2015-11-02 16:55:02 391
原创 LeetCode OJ : Single Number II
题目: 我的代码:class Solution {public: int singleNumber(vector<int>& nums) { vector<int>::size_type i = 0, j = 0, k = 0; vector<int> repeat_elem; bool Is_repeat; int te
2015-11-02 11:07:34 457
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人