#include <iostream> using namespace std; int (*ptr)(int a,int b);int fun(int x,int y){ int z; z=x>y?x:y; return z; } int fun3(int a){//传的是副本 cout<<"** ...
分类:
其他好文 时间:
2016-09-09 20:50:51
阅读次数:
174
递归方式: 1 public static Object[] mergeSort(Object[] o) { 2 o = o.clone(); 3 mergeSort(o, 0, o.length - 1); 4 return o; 5 } 6 7 private static void merge ...
分类:
其他好文 时间:
2016-09-09 20:36:55
阅读次数:
166
1.工厂模式: 缺点:无法解决对象识别问题。 2.函数构造模式: 注意: 函数名首字母大写;必须用new操作符创建对象;构造模式中没有明显的创建对象,直接将属性和方法赋值给了this对象;没有return语句;可通过instanceof操作符区分对象实例; 创建Person的新实例,必须使用new操 ...
分类:
其他好文 时间:
2016-09-09 18:46:58
阅读次数:
151
js代码:.directive('validateNumberLetter', function () { return { require: 'ngModel', link: function (scope, elm, attrs, ctrl) { scope.$watch(attrs.ngMod ...
分类:
Web程序 时间:
2016-09-09 18:44:32
阅读次数:
234
ES6 引入箭头函数有三大好处,首先,一个简洁的语法;第二,隐式return,能写成一行;第三,当你执行点击操作的语句不用在一个函数内部了。 访问ES6.io那里有大量的例子可以看一看。 对一个数据添加名称: 我们想添加Bos 到每个数组值的后面。 通常我们会这样做: 我们在这里用了引号,这是字符串 ...
分类:
编程语言 时间:
2016-09-09 18:35:34
阅读次数:
387
判断字符串是不是数字? 方法一: /** * 用于验证获取的字符串是不是数字 * @param str * @return */ public static boolean isNumeric(String str) { for (int i = 0; i < str.length(); i++) ...
分类:
其他好文 时间:
2016-09-09 16:42:32
阅读次数:
115
关键:将数组的地址送到函数中;其中数组名可以作为函数的首地址。 #include<stdio.h>int sort(int *p,int n){ int i,j,ret=0,temp; if(p==NULL) {printf("error:sort(int *p)%d",ret); return r ...
分类:
编程语言 时间:
2016-09-09 15:14:44
阅读次数:
152
文章首发于浩瀚先森博客 直接上代码public struct SerialPara { private string portName; public string PortNameSetGet { get { return portName; } set { portName = value;..... ...
#include <iostream> using namespace std; void hanno(char a,char b,char c,int s){ if(s==1) { cout<<a<<" "<<c<<endl; return; } else{ hanno(a,c,b,s-1); c ...
分类:
其他好文 时间:
2016-09-09 15:00:45
阅读次数:
124
app.directive("itemPopover",function($timeout){ return { restrict : "A", link : function(scope,element,attrs){ element.popover(); var createText = "<d ...
分类:
Web程序 时间:
2016-09-09 12:05:02
阅读次数:
215