码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
hdu 1213 How Many Tables(并查集求无向图有几个连通分量)
代码: #include #include using namespace std; int n,m; int father[1005]; int Find(int a) { int r=a; while(father[a]!=a) { a=father[a]; } father[r]=a; return a; } void ...
分类:其他好文   时间:2015-07-24 22:46:06    阅读次数:208
AngularJs编写指令
1 2 3 4 5 6 7 8 9 10 11 12 30 31 重点在于上面的return.下面看看return中的所有的参数. 1 { 2 restrict: String, 3 priority: Number...
分类:Web程序   时间:2015-07-24 22:29:38    阅读次数:188
LeetCode#27 Remove Element
Problem Definition:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be chan...
分类:其他好文   时间:2015-07-24 22:29:06    阅读次数:148
获取文件夹下所有文件(包括子文件)放在list<File>中
public static List getAllFileList(File rootFile) { return getAllFileList(rootFile.getAbsolutePath(), null); } /**  * 获取文件夹下所有文件(包括子文件)  *   * @param filePath  * @param fileList  * @return...
分类:其他好文   时间:2015-07-24 20:56:52    阅读次数:116
block和协议和foundation
block1)用来保存一段代码2)block的标志:^例子: int sum(int a, int b){ return a+b; } int (*p)(int, int) = sum; int (^sumblock)(int, int) = ^(int a, int b){ return a+b;...
分类:其他好文   时间:2015-07-24 20:44:03    阅读次数:151
PHP生成唯一订单号
function build_order_no(){ return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);}用uniqid获取一个基于当前...
分类:Web程序   时间:2015-07-24 20:39:48    阅读次数:181
LPEG
local lpeg = require "lpeg" function f0() end; function f1() return "a" end function f2() return "a","b" end function ittable(t) for key, value in pa....
分类:其他好文   时间:2015-07-24 20:36:31    阅读次数:245
根据后序遍历和中序遍历的数组构建二叉树
我的代码是:TreeNode* buildTree (vector &inorder, vector &postorder){ if (inorder.empty ()) { return nullptr; } unordered_map inItDic; ...
分类:编程语言   时间:2015-07-24 20:34:30    阅读次数:158
扩展欧几里德算法求逆元3
1 int gcd(int x3,int y3) 2 { 3 int x1 = 1,x2 = 0,y1 = 0,y2 = 1; 4 while(1) 5 { 6 if (y3==1) return y2; 7 int q=x3/y3; 8 ...
分类:编程语言   时间:2015-07-24 20:17:44    阅读次数:117
几道水题(18岁的生日,空心三角形)
18岁的生日: 1 #include 2 int m[13]={31,28,31,30,31,30,31,31,30,31,30,31}; 3 int nian(int x){ 4 if(x%400==0||(x%4==0&&x%100!=0))return 1; 5 else re...
分类:其他好文   时间:2015-07-24 20:14:36    阅读次数:127
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!