在调用一个函数的过程中又出现直接或间接地调用 该函数本身,称为函数的递归(recursive)调用.包含递归调用的函数称为递归函数.在实现递归时,在时间和空间上的开销比较大求n! 1 #include 2 using namespace std; 3 4 long func(int n); 5 .....
分类:
编程语言 时间:
2014-07-18 20:06:46
阅读次数:
206
扩展欧几里得#include#include#include#include#define maxn 3000009#define ll long longusing namespace std;void gcd(ll a,ll b,ll& d,ll& x,ll &y){ if(!b){d=a...
分类:
其他好文 时间:
2014-07-18 19:39:25
阅读次数:
312
#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long ...
分类:
其他好文 时间:
2014-07-18 19:22:03
阅读次数:
157
直接搜索,简单题;#include#include#include#include#include#define maxn 505#define ll long longusing namespace std;int map[maxn][maxn];int dir[4][2]={{0,1},{1,0...
分类:
其他好文 时间:
2014-07-18 17:05:58
阅读次数:
208
DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to ...
分类:
其他好文 时间:
2014-07-18 15:28:57
阅读次数:
234
在VS2010中使用MFC,使用UNICODE调用TRACE,输出_CrtDbgReport: String too long or IO Error可尝试使用OutputDebugString函数
分类:
数据库 时间:
2014-07-18 09:21:53
阅读次数:
413
1、建立进行读写文件的java类//写文件public static void WriteFile(String filename,long counter) throws IOException {PrintWriter out=new PrintWriter(new FileWriter(fil...
分类:
Web程序 时间:
2014-07-18 00:38:17
阅读次数:
238
1 long g = 1024 * 1024 * 1024; 2 long m = 1024 * 1024; 3 long k = 1024; 4 if (size = 1) 5 ...
分类:
其他好文 时间:
2014-07-17 22:39:31
阅读次数:
272
来源:http://blog.csdn.net/apull/article/details/5379819一、获取日历时间time_t是定义在time.h中的一个类型,表示一个日历时间,也就是从1970年1月1日0时0分0秒到此时的秒数,原型是:typedef long time_t; /* tim...
分类:
编程语言 时间:
2014-07-17 22:07:15
阅读次数:
507
约定: 1) 下面的测试题中,认为所有必须的头文件都已经正确的包含了 2)数据类型 char 一个字节 1 byte int 两个字节 2 byte (16位系统,认为整型是2个字节) long int 四个字节 4 byte float 四个字节4 byet double 八个字节 8 by...
分类:
其他好文 时间:
2014-07-17 17:36:13
阅读次数:
310