今天遇到一个EditCtrl问题。要求在MFC对话框上添加一个EditCtrl控件,此控件只能输入10-100之间的整型数。
实现:
1、将EditCtrl的属性中的 外观->number设为True,这时控件只能输入0-9这10个字符。
2、在对话框对应的类中添加一个整型变量m_iNumber,并在构造函数中初始化为0.
3、为控件添加失去焦点时的响应函数:
void CMfc...
分类:
其他好文 时间:
2014-07-27 11:32:42
阅读次数:
300
Description
A number is called a Mirror number if on lateral inversion, it gives the same number i.e it looks the same in a mirror. For example 101 is a mirror number while 100 is not.
Given two ...
分类:
其他好文 时间:
2014-07-27 11:10:22
阅读次数:
204
题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.题解:这道题跟NQueens的解法完全一样(具....
分类:
编程语言 时间:
2014-07-27 11:00:42
阅读次数:
241
这么基础的东西实在不应该再记录了,不过嘛,温故知新~就先从数据类型开始吧js六大数据类型:number、string、object、Boolean、null、undefinedstring: 由单引号或双引号来说明,如"string"number:什么整数啊浮点数啊都叫数字,你懂的~Boolean:...
分类:
Web程序 时间:
2014-07-27 10:50:32
阅读次数:
194
题目:Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtim....
分类:
编程语言 时间:
2014-07-27 10:46:02
阅读次数:
294
题目:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime comp....
分类:
编程语言 时间:
2014-07-27 10:43:42
阅读次数:
239
这题被出题人给活活坑了,题目居然理解错了。。哎,不想多说。题意:给两组数,A组为幸运基数,B组为不幸运的基数,问在[low,high]区间内有多少个数:至少被A组中一个数整除,并且不被B中任意一个数整除。|A|#include #include #include #include #define l...
分类:
其他好文 时间:
2014-07-27 10:06:52
阅读次数:
224
定理:一个正整数 n 可以用素因子唯一表示为 p1^r1 * p2^r2 * ...
pk^rk (其中 pi 为素数) , 那么这个数的因子的个数就是,(r1+1)*(r2+1)*...*(rk+1).
理解:为什么是加1之后再相乘,因为一个数的的因子数至少为1和他自身,但因为r1,r2。。可以为0,所以因子的个数为(r1+1)。。。
拓展一下:
定理1: 一个正整数 n 可以用素...
分类:
其他好文 时间:
2014-07-26 15:32:46
阅读次数:
194
Problem Description:
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only b...
分类:
其他好文 时间:
2014-07-26 15:24:02
阅读次数:
252
首先确认下什么是素数,又称质数
百度的定义解答:
质数(prime number)又称素数,有无限个。一个大于1的自然数,如果除了1和它本身
外,不能被其他自然数整除(除0以外)的数称之为素数(质数)
明确了素数的定义后,下面用java来判断素数以及穷举2-999以内的素数,还是一样,主
要看的是对一个数进行判断或者对一组数进行判断的思想,至于怎样判断的,百度的定义已经给...
分类:
编程语言 时间:
2014-07-26 15:11:27
阅读次数:
238