上一页 1 ··· 80 81 82 83 84 85 86 87 88 ··· 455 下一页
方法一:很容易想到的解法是直接使用递归。C++代码:#include "stdafx.h"#include using namespace std;long long Fibonacci(unsigned int n){ if (n == 0) { return 0; } if (n == 1) { return 1; } return Fibonacci(n-1) + Fibonacci(n-2);}int _tmain(int argc, _TCHAR* argv[]){ unsigned int n = 10; cout using namespace std;lo. Read More
posted @ 2013-07-20 19:25 javawebsoa Views(211) Comments(0) Diggs(0)
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=3746 KMP算法—— AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int N=200005;const LL II=100000000;const int Read More
posted @ 2013-07-20 19:23 javawebsoa Views(211) Comments(0) Diggs(0)
1.所有头文件都应该使用#define 防止头文件被多重包含,命名格式可以参考___H2.使用前置声明尽量减少.h文件中#include的数量,导致不必要的重新编译 详解:http://blog.csdn.net/justkong/article/details/93887333.函数参数:输入参数在前,输出参数在后。输入参数一般传值或常数引用,输出参数或输入输出参数为非常数指针。4. .cpp头文件包含顺序 同名头文件 C系统文件 C++系统文件 其它库头文件 本项目内其它头文件5.命名空间 (1)分为有名和无名的命名空间(2)不能在命名空间的定义中声明子命名空间,不能在命名空间外使用&qu Read More
posted @ 2013-07-20 19:21 javawebsoa Views(211) Comments(0) Diggs(0)
class mythread extends Thread //多线程的启动 { private String name; public mythread(String name) { this.name=name; } public void run() { for(int i=0;i<10;i++) { System.out.println("线程"+name+"运行结果:"+i); } } } public class test58 { public static void main(String args[]) { mythread a=n Read More
posted @ 2013-07-20 19:19 javawebsoa Views(207) Comments(0) Diggs(0)
基于.NET的快速信息化系统开发整合框架 —RDIFramework.NET—系统目录框架简单介绍.NET快速开发整合框架(RDIFramework.NET),基于.NET的快速信息化系统开发、整合框架,给用户和开发者最佳的.Net框架部署方案。为企业或个人在.NET环境下快速开发系统提供了强大的支持,开发人员不需要开发系统的基础功能和公共模块,平台自身提供了强大的函数库和开发包,开发人员只须集中精力专注于业务部分的开发,因此大大提高开发效率和节约开发成本。平台采用目前最主流的C#语言开发完成,运行在Windows平台上。产品可用于对多个项目(单项目也可以)进行整合,提供统一的权限与模块控制, Read More
posted @ 2013-07-20 19:17 javawebsoa Views(336) Comments(0) Diggs(0)
此文版权属于作者所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意! 参考:What is the colon equals sign ( := ) in makefiles? Makefile 文件里面用 :=,表示变量赋值的时候立刻展开。用 =,表示变量被用的时候才展开。下面是例子:animal=frog var="$(animal) dog cat" animal=hello test: @echo $(var) #输出结果是: #hello dog cat animal=frog var:="$(animal) dog cat" anim Read More
posted @ 2013-07-20 19:15 javawebsoa Views(189) Comments(0) Diggs(0)
activity代码 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.form_widget); showDatePicker(); } private void showDatePicker() { // TODO Auto-generated method stub DatePicker datePicker = (DatePicker)findVie... Read More
posted @ 2013-07-20 19:13 javawebsoa Views(209) Comments(0) Diggs(0)
A.数据量很小,直接爆搞。#include #include #include #include #include #include #include #include #include #include #include #include #define PI acos(-1.0)#define Max 2505#define inf 1using namespace std;int a[111] ;int num[11111] ;int main() { int n ; cin >> n ; int ans = 0 ; for (int i = 1 ; i > a[... Read More
posted @ 2013-07-20 19:10 javawebsoa Views(364) Comments(0) Diggs(0)
引子:看了归并排序,觉得这才真正像个算法,插入,选择,冒泡简直特么的就像是暴力猜解密码一样的弱。测试了100000个随机数字的排序,比上述3个算法的运行时间少了近100倍的数量级。 算法思想:归并排序的主要思路是分治,可以大概参考二分查找的思路,并且也是递归的方式。 首先按数组长度将数组切成左右两半,先将左边排序,再将右边排序,再将两边的合并起来,并且在合并的过程中排序,需要在栈中建立一个新的同样大小的数组用于缓存。在每次拆分以后,有一个起点索引 nStart,一个中点索引 nMid,一个终点索引nEnd,这时需要再次将nStart到nMid拆分成三个节点,直到nStart大于或等于nEnd, Read More
posted @ 2013-07-20 19:08 javawebsoa Views(199) Comments(0) Diggs(0)
在开发过程中,我可能会需要向某些对象发送一些请求,但是我们不知请求的具体接收者是谁,也不知道被请求的操作是那个,我们只知道在程序运行中指定具体的请求接收者即可。打个比方,电视遥控器,我们只需要知道按那个按钮能够打开电视、关闭电视和换台即可,并不需要知道是怎么开电视、关电视和换台的。对于这种情况,我们可以采用命令模式来进行设计。 一、基本定义 命令模式将请求封装成对象,以便使用不同的请求、队列或者日志来参数化其他对象。命令模式支持可撤销的操作。 命令模式可以对发送... Read More
posted @ 2013-07-20 19:08 javawebsoa Views(221) Comments(0) Diggs(0)
上一页 1 ··· 80 81 82 83 84 85 86 87 88 ··· 455 下一页