码迷,mamicode.com
首页 >  
搜索关键字:fun    ( 10813个结果
一个非常有用的算法---统计二进制数中1的个数
本人算法小菜,看见一个非常好的算法,统计一个数的二进制数的1的个数。觉得不错,与大家分享。1 int fun(int x){2 int count = 0;3 while(x){4 count++;5 x = x &(x-1)6 }7 ...
分类:编程语言   时间:2015-06-28 11:04:25    阅读次数:118
[00000]-[2015-06-22]-[00]-[C++ 虚函数]
C++语言的多态性 与 C++类的虚函数有关引入一个问题:定义一个基类指针,指向派生类对象,然后根据指针调用相应的方法,会有什么效果?class CBase{public: virtual void vfun() { coutvfun(); pBase->fun(); // 输出...
分类:编程语言   时间:2015-06-27 23:55:33    阅读次数:161
第十六周 程序阅读
#include using namespace std; int a[10]= {1,2, 3, 4, 5, 6, 7, 8, 9, 10}; int fun( int i); int main() { int i ,s=0; for( i=0; i<=10; i++) { try { s=s+fun(i); ...
分类:其他好文   时间:2015-06-27 16:28:28    阅读次数:118
树莓派2+无线网卡==伪热点+钓鱼网站
0x1 关于树莓派 TheRaspberry Piis a tiny and affordable computer that you can use to learn programming through fun, practical projects. 树莓派是一个小型的而且很便宜的($3.....
分类:Web程序   时间:2015-06-27 16:12:27    阅读次数:256
python args & kwargs
Today,We will talk some about the argument and arguments ...#!/usr/bin/pythondef fun(*args): for value in args: print valueif __name__ == '_...
分类:编程语言   时间:2015-06-26 23:38:57    阅读次数:188
模拟DLL加载
#include #include #include typedef int (*PFUNC)(int,int);typedef struct{ int Position; int Length;}Fun;typedef struct{ int num; Fun *pFun;...
分类:其他好文   时间:2015-06-26 19:41:38    阅读次数:115
c++ 输出虚函数表内容
class Base{ public: virtual void f(){cout<<"Base::f"<<endl;} virtual void g(){cout<<"Base::g"<<endl;} virtual void h(){cout<<"Base::h"<<endl;} }; typedef void (*Fun)(void); int main(){ Base b...
分类:编程语言   时间:2015-06-25 23:03:04    阅读次数:181
(算法)关于随机数的生成
题目:1、一个函数fun()均匀返回0和1,各自的概率是50%,利用这个函数实现一个函数,使之返回 1的概率为3/4,0的概率为1/4。2、假如有一个函数rand5能等概率生成1 - 5 之间的整数,如何利用rand5来实现rand7?rand7函数的要求是能够等概率生成1 - 7之间的整数。思路:...
分类:编程语言   时间:2015-06-25 19:16:33    阅读次数:107
早绑定和迟绑定技术的通俗分析
概念: 早绑定指的是在编译阶段进行绑定 迟绑定指的是运行阶段绑定 例子: Class Base { void fun(){} } Class Bind :Class Base { Void fun(){} } main() { Base base; base->fun(); Bind *tmp; tmp  = &base; tmp->fun(); ...
分类:其他好文   时间:2015-06-25 15:37:19    阅读次数:96
js验证表单大全
js验证表单大全 1. 长度限制 2. 只能是汉字 3." 只能是英文 4. 只能是数字 5. 只能是英文字符和数字 6. 验证油箱格式 7. 屏蔽关键字(这里屏蔽***和****) 8. 两次输入密码是否相同 路政管理系统应用: //非空验证 fun...
分类:Web程序   时间:2015-06-25 10:09:32    阅读次数:178
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!