一:函数的基本用法
function test1(num1,num2){
return num1+num2;
}
//普通调用
window.alert(test1(2,3));
//指针调用
var my=test1;
window.alert(my);
var res=my(3,4);
alert(res);
二:函数调用机制
function abc(...
分类:
编程语言 时间:
2015-07-24 10:44:09
阅读次数:
135
virtual关键字用于修饰方法、属性、索引器或事件声明,并且允许在派生类中重写这些对象。例如,此方法可被任何继承它的类重写。 public virtual double Area() { return x * y; } 备注: 调用虚方法时,将为重写成员检查该对象的运行时类型。将调用大部分派生类中...
分类:
其他好文 时间:
2015-07-24 10:40:53
阅读次数:
82
//将要开始编辑- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{ NSLog(@"快要开始编辑了"); return YES;}- (void)applicationWillResignActive:(UIApplicatio...
分类:
其他好文 时间:
2015-07-24 10:40:43
阅读次数:
85
1 int multi(int a,int b) 2 { 3 if(b==0) 4 return 1; 5 if(b==1) 6 return a; 7 int ret=multi(a,b/2); 8 ret=(ret*ret)%MO...
分类:
其他好文 时间:
2015-07-24 10:36:57
阅读次数:
112
问题描述Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example,Given the following matrix:[ ...
分类:
其他好文 时间:
2015-07-24 10:29:26
阅读次数:
132
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
class Soluti...
分类:
其他好文 时间:
2015-07-24 09:21:49
阅读次数:
107
在介绍Swift中的函数与方法之前,我们先看看objective-c中函数与方法的写法,以求两个数的和为例:
1. 函数写法
int sum(int a, int b) {
return a + b;
}
2. 方法写法
- (int)sum:(int)a b:(int)b {
return a + b;
}
从上面可以看出,两者的写法还是有很大不同的。而到了Swift中...
分类:
编程语言 时间:
2015-07-24 09:16:45
阅读次数:
139
问题描述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 changed. It doesn't...
分类:
其他好文 时间:
2015-07-24 09:16:36
阅读次数:
117
【024-Swap Nodes in Pairs(成对交换单链表的结点)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return...
分类:
编程语言 时间:
2015-07-24 08:05:47
阅读次数:
166
【025-Reverse Nodes in k-Group(单链表中k个结点一组进行反转)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of...
分类:
编程语言 时间:
2015-07-24 08:04:47
阅读次数:
143