摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2067这是一道卡特兰数,请看资料:http://baike.baidu.com/view/2499752.htm其实就是应用代码:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>int main(){ int m,i,j,t=0; __int64 a[40][40]; while(scanf("%d",&m),m!=-1) { t++; 阅读全文
posted @ 2011-08-12 19:55 ○o尐懶錨o 阅读(400) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2065据说这是一个母函数指数型,可是我看了半天觉得还是没有感觉,觉得还是递推比较好,直接看代码可能不懂,但是推理过程太麻烦。。。就是从n-1个来确定第n个,这样一步一步找到规律代码:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>int main(){ __int64 n; int t; int a[23]={0,2,6,20,72,72,56,60,12,92,5 阅读全文
posted @ 2011-08-12 18:06 ○o尐懶錨o 阅读(714) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2072这是我第一次写的c++;当然是参考神牛的,库函数真是太强大了,我觉得一个很长的代码,用了几行代码就搞定了,看来以后要好好学习库函数#include<set>#include<iostream>#include<cstring>using namespace std;int main(){ set <string> st; string s=""; char c; while((c=getchar())!='#') { s 阅读全文
posted @ 2011-08-12 12:27 ○o尐懶錨o 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 首先我们来看这个全局变量:__FILE__它表示文件的完整路径(当然包括文件名在内)也就是说它根据你文件所在的目录不同,有着不同的值;当然,当它用在包行文件中的时候,它的值是包含的路径;然后:我们看这个函数:string dirname ( string path )它是PHP内置函数,它的作用是什么呢,就是返回除了本文件名以外的所在目录,给你举个例子假如你的首页中用到了_FILE_这个变量:(假设你的网页所在目录为:http://localhost/web/index.php),那么:_FILE_的值为http://localhost/web/index.php(一个绝对路径)。而此时dir 阅读全文
posted @ 2011-08-12 11:01 ○o尐懶錨o 阅读(9205) 评论(0) 推荐(1) 编辑