最近学习遇到自定义数组排序函数usort()有些不了解,搜了很多地方都没有很好的解释,自己研究好久,发来与和我一样的初学者共享~bool usort ( array &$array , callable $cmp_function ) 函数为对数组进行自己自定义排序,排序规则由$cmp_fun...
分类:
Web程序 时间:
2015-07-20 22:56:16
阅读次数:
149
一、内部类的几种创建方法:1、成员内部类class Outer{ private int i = 1; class Inner{ public void fun() {System.out.println("Outer I=" + i)} } ...
分类:
编程语言 时间:
2015-07-20 18:21:20
阅读次数:
162
讲解康托展开与逆康托展开。http://wenku.baidu.com/view/55ebccee4afe04a1b071deaf.html#includeusing namespace std;int fac[20];int fun(){ fac[0]=1; int i; for...
分类:
其他好文 时间:
2015-07-19 19:32:44
阅读次数:
127
#include
#include
#include
using namespace std;
int fun(int a,int b){
int c = 0;
int d = 1;
stack st;
while(b){
st.push(b & 1);
b >>= 1l;
}
while(!st.empty()){
int t = st.top();
st.p...
分类:
其他好文 时间:
2015-07-19 18:14:03
阅读次数:
120
题目传送门 1 /* 2 数学:这题一直WA在13组上,看了数据才知道是计算cost时超long long了 3 另外不足一个区间的直接计算个数就可以了 4 */ 5 #include 6 #include 7 #include 8 #include 9 #incl...
分类:
其他好文 时间:
2015-07-19 14:55:30
阅读次数:
89
指针函数是指函数的返回值是指针类型的函数。一个函数的返回值可以是整数,实型和字符类型,也可以是指针类型。指针类型的定义形式举例如下:
float* fun(int a,int b);
其中,fun是函数名,前面的“*”说明返回值的类型是指针类型,因为前面的类型标识是float,所以返回的指针指向浮点型。该函数有两个参数,参数类型是整型。
通过一个题目学校指针函数的用法。
例如:假设若干个学...
分类:
其他好文 时间:
2015-07-18 00:39:04
阅读次数:
130
1> dbg:tracer().{ok,}2> dbg:p(all, c).{ok,[{matched,nonode@nohost,26}]}3> dbg:tpl(test, g, dbg:fun2ms(fun(_) -> exception_trace() end)).{ok,[{matched,...
分类:
数据库 时间:
2015-07-17 18:24:14
阅读次数:
303
#2函数函数声明和平时我见到的有点不太一样,使用关键字fun来声明。(感觉好欢乐的样子···O(∩_∩)O~~)下面的示例,简单的声明了一个函数:1 // 这是函数声明2 fun this_is_a_function() {3 // 这里是函数内部 4 }好,下面我们一步一步来,首先是有返...
分类:
其他好文 时间:
2015-07-17 13:44:19
阅读次数:
106
#0 下载与配置:官网上写的很详细,不再重复。#1 Hello world1 fun main(args: Array) {2 println("Hello, world!")3 }每种语言上来都要写Hello world···
分类:
其他好文 时间:
2015-07-17 11:54:15
阅读次数:
119
curry函数是向一个函数传入部分的参数,从而产生一个新的函数,来达到对函数实现套用的操作首先我们为所有的函数原型添加一个方法Function.prototype.method = function(name,func) { this.prototype[name] = fun...
分类:
其他好文 时间:
2015-07-17 11:29:35
阅读次数:
226