码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
leetcode第23题--Swap Nodes in Pairs
Problem: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.Yo...
分类:其他好文   时间:2014-10-20 13:15:42    阅读次数:195
java 获取本机ip地址
/** * 取当前系统站点本地地址 linux下 和 window下可用 * * @return */ public static String getLocalIP() { String sIP = ""; InetAddress ...
分类:编程语言   时间:2014-10-20 13:07:26    阅读次数:195
阶乘逆元线推(巩固+优化)
有时候在计算组合数的时候会经常用n!的逆元,如果n= 0; i--) Inv[i] = Inv[i+1] * (i + 1) % MOD;然后在使用的时候是直接return Fac[N]*Inv[M]%MOD*Inv[N-M]%MOD;//计算C(N, M),注意不要溢出如果MOD比N要小的话要注意...
分类:其他好文   时间:2014-10-20 13:03:22    阅读次数:205
JAVA基础实例(一)
1写一个方法,用一个for循环打印九九乘法表 /** *一个for循环打印九九乘法表 */ public void nineNineMultiTable() { for (int i = 1,j = 1; j System.out.print(i+"*"+j+"="+i*j+" "); if(i==j) { i=0; j++; System.out....
分类:编程语言   时间:2014-10-20 11:46:41    阅读次数:151
Linked List Cycle II
Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.比I麻烦点的就是找到循环开始点TATI只是判断是否循环。要求不使用额外空...
分类:其他好文   时间:2014-10-20 11:40:37    阅读次数:134
Thinkphp在Tpl中调用common.php中的公共函数
Common/common.php//产生随机验证码function random($length, $chars = '0123456789'){ //随机生成的逻辑 return $hash;}Tpl/index.html{:random(5)}得到的结果:9536
分类:Web程序   时间:2014-10-20 11:38:40    阅读次数:214
Leetcode | Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->...
分类:其他好文   时间:2014-10-20 11:19:05    阅读次数:173
MFC将句柄转换成指针
假设现有一个对话框窗口,要获取该窗口内的一个编辑框控件的指针。方法:HWNDhdlg=::FindWindow(NULL,_T("DialogName"));//获取窗口句柄if(hdlg==NULL){MessageBox(_T("获取窗口句柄失败!"));return;}HWNDhEdit=::GetDlgItem(IDC_ENDIT1);//获取窗口控件编辑框的句柄if(hEdit==..
分类:编程语言   时间:2014-10-20 10:11:54    阅读次数:215
键盘滚动到当前文本框和按return隐藏
-(void) viewWillAppear:(BOOL)animated { //注册键盘出现通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (keyboardDidshow:) ...
分类:其他好文   时间:2014-10-20 10:03:58    阅读次数:192
python 虎口里拔牙 括号中取东西
怎么获取 [ ]中的字符串或者数字http://stackoverflow.com/questions/4894069/python-regex-help-return-text-between-parenthesis例程:[[ 1.1916991]][[ 0.87677399]][[ 0.6911...
分类:编程语言   时间:2014-10-20 09:53:45    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!