码迷,mamicode.com
首页 >  
搜索关键字:step return    ( 64763个结果
C++ Daily 《4》----一个简单的 int to string 的方法
经常会在项目中用到 int to string #include #include #include using namespace std; int main(void) { ostringstream num; num << 123; string str = num.str(); cout << str << endl; return 0; }...
分类:编程语言   时间:2014-07-22 23:04:54    阅读次数:283
【LeetCode】- Length of Last Word(最后一个单词的长度)
[ 问题: ] Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. [...
分类:其他好文   时间:2014-07-22 23:01:35    阅读次数:331
【LeetCode】- Search Insert Position(查找插入的位置)
[ 问题: ] Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in th...
分类:其他好文   时间:2014-07-22 23:01:15    阅读次数:270
Lua进阶(一)——函数闭包、元表
函数闭包 function createCountdownTimer(second) local ms=second * 1000; local function countDown() ms = ms - 1; return ms; end return countDown; end timer1 = createCountdownTimer(1); for...
分类:其他好文   时间:2014-07-22 22:59:53    阅读次数:307
HDU 4735 DLX爆搜
Little Wish~ lyrical step~ Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 417    Accepted Submission(s): 109 Problem Description N chi...
分类:其他好文   时间:2014-05-02 04:37:42    阅读次数:393
看书小记5(《C专家编程》)
函数指针 1. 函数与函数指针类型要匹配; 2. 函数指针用来保存函数首地址,即可以通过该指针访问函数; 3. 函数指针可以指向一类函数,而不是一个函数,即可以重新赋值。 int maxNumber(int a, int b) { return a > b? a: b; } void fileFunc(){ cout void editFunc(){ ...
分类:其他好文   时间:2014-05-02 04:33:25    阅读次数:276
hdu1221
求矩形和圆是否相交或相切。 #include #include #define judge(x,y) x<y||fabs(x-y)<0.00000001 double dis(int x,int y,int a,int b) { return (x-a)*(x-a)+(y-b)*(y-b); } int main() { int T; scanf(...
分类:其他好文   时间:2014-04-30 22:45:38    阅读次数:365
js:深入函数(函数是对象)
//由于函数是对象,所以可以直接把函数通过参数传递进来;也可以把函数作为返回值。 function calFun(fun,arg){   //第一个参数就是函数对象   return fun(arg); } function sum(num){   return num+100; } function say(str){   alert("hello "+str); } //...
分类:Web程序   时间:2014-04-30 22:41:38    阅读次数:324
【梦幻连连连】源码分析(一)
进入游戏连连第一个场景,如下:   初始化该场景精灵所需的信息、背景/音效及图层UI bool HelloWorld::init() {     //////////////////////////////     // 1. super initfirst     if (!CCLayer::init() )     {         return false;...
分类:其他好文   时间:2014-04-30 22:34:40    阅读次数:226
查询、创建、设置注册表键值的示例代码
示例代码将在注册表位置:HKEY_CURRENT_USER\Software\  读写键值 bool LicenseManage::OpenRegKey(HKEY& hRetKey) { if (ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,"Software", &hRetKey)) { return true; ...
分类:其他好文   时间:2014-04-30 22:12:40    阅读次数:195
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!