码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
[LintCode] 尾部的零
1 class Solution { 2 public: 3 // param n : description of n 4 // return: description of return 5 long long trailingZeros(long long n) ...
分类:其他好文   时间:2015-06-28 17:04:28    阅读次数:213
[LintCode] 最长公共子串
1 class Solution { 2 public: 3 /** 4 * @param A, B: Two string. 5 * @return: the length of the longest common substring. 6 */ ...
分类:其他好文   时间:2015-06-28 17:00:49    阅读次数:94
[LintCode] 最后一个单词的长度
1 class Solution { 2 public: 3 /** 4 * @param s A string 5 * @return the length of last word 6 */ 7 int lengthOfLastWord(strin...
分类:其他好文   时间:2015-06-28 16:53:33    阅读次数:145
[LintCode] 有效回文串
1 class Solution { 2 public: 3 /** 4 * @param s A string 5 * @return Whether the string is a valid palindrome 6 */ 7 bool isPa...
分类:其他好文   时间:2015-06-28 16:46:14    阅读次数:298
Leetcode 24 Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:其他好文   时间:2015-06-28 15:32:03    阅读次数:126
字典转模型
/** 将image懒加载,获取图片 使用self.icon给image赋值*/-(UIImage *)image { if (_image == nil) { _image = [UIImage imageNamed:self.icon]; } return _im...
分类:其他好文   时间:2015-06-28 15:29:13    阅读次数:106
Bitwise AND of Numbers Range
Given a range [m, n] where 0 >1; n = n>>1; count++; } return m<<count; }}
分类:其他好文   时间:2015-06-28 15:22:19    阅读次数:93
ado.net调用存储过程
存储过程创建如下:create proc jiancha(@a int,@b nvarchar(20),@c int output)asset @a=3;set @b='ssss';set @c=1;return 7777;Go其中,@c是输出参数,然后return 7777是返回值。然后,ado....
分类:Web程序   时间:2015-06-28 14:00:13    阅读次数:185
编程实现strcat(字符串连接)
实现库函数strcat 字符串的连接,给出核心代码,至于安全性,就不考虑了。 char* strcat(char* dest, const char* src) { char* crtn = dest; while(*dest++); dest--; while((*dest++ = *src++) != '\0'); return crtn; } 还有更简单的做法吗?...
分类:其他好文   时间:2015-06-28 12:50:53    阅读次数:129
编程实现字符串查找strstr,find
字符串查找两种情况,查找返回子字符串的指针位置和在字符串中的位置。 1. const char* strstr(const char* src, const char* sub) { if (src == NULL && sub == NULL) { return src; } const char* ps = src; const char* pb = sub; while ...
分类:其他好文   时间:2015-06-28 12:49:28    阅读次数:99
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!