使用递归函数
#include
int count;
int fun(int x)
{
if(x==0)
return 0;
else
{
printf("%d",fun(x/2));
if (x%2 == 1)
{
count++;
return x%2...
分类:
其他好文 时间:
2015-01-14 09:47:44
阅读次数:
179
示例一、根据输入的部门编号找到这个部门的所有员工首先创建包,定义包规范create or replace package getemp_pkg is FUNCTION getemp_fun(p_dno dept.deptno%type) RETURN SYS_REFCURSOR; --返回弱类型游....
分类:
其他好文 时间:
2015-01-11 19:09:12
阅读次数:
188
%% @author Rolong
-module(process1).
-compile(export_all).
-define(I(F), io:format(F++"~n", [])).
-define(I(F, A), io:format(F++"~n", A)).
%% Usage:
%%
%% 启动进程:Pid = process1:start(Fun).
%% ...
分类:
系统相关 时间:
2015-01-11 11:04:38
阅读次数:
168
//看这样一段程序:
#include
char* fun()
{
return "fun";
}
int main()
{
printf("%s", fun());
return 0;
}
这段程序可以正常run,但是最好不要这么做。
因为
直观上你返回了一个局部的东西出去。
你可以再外面定义这个常量,然后返回。...
分类:
其他好文 时间:
2015-01-08 11:21:34
阅读次数:
119
c++/c使用__declspec(target(mic))函数或变量声明或__attribute__((target(mic)))函数或变量声明举例如下:__attribute__((target(mic))) int a;__attribute__((target(mic))) void fun...
分类:
其他好文 时间:
2015-01-07 21:52:32
阅读次数:
236
一个集合,里面有年和月的属性,按照年和月进行分组显示数据 var groupByYearMonth = _.chain(topics).groupBy(function (item) { return item.TopicYear * 100 + item.TopicMonth }).map(fun...
分类:
Web程序 时间:
2015-01-07 18:31:18
阅读次数:
132
函数式编程 函数式编程(functional programming)的思想相对于命令式编程(imperative programming),告诉计算机你要什么而不是告诉它要怎么做,举个例子: (defun fun(x)
(list ‘a (expt (car x) 2))) 这是函...
分类:
其他好文 时间:
2015-01-07 01:55:36
阅读次数:
112
# 刷新会员标签函数 {color:red} fun_refresh_code{color} {noformat}CREATE OR REPLACE FUNCTION fun_refresh_code(v_code NUMBER := 0) RETURN varchar2 IS vsql ...
分类:
数据库 时间:
2015-01-05 20:26:36
阅读次数:
303
Elasticsearchis a great search engine, flexible, fast and fun. So how can I get started with it? This post will go through how to get contents from aS...
分类:
数据库 时间:
2015-01-05 00:23:42
阅读次数:
509