摘要: Nontype Template Parameters非类型模板参数对 function templates 和 class templates 而言,template parameters 并不一定非要是类型(types) 不可,它们也可以是常规的(一般的)数值。当你以类型(types)作为 te... 阅读全文
posted @ 2014-05-10 16:43 剑风云 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 3.3 Class Templates 的特化( Specializations)你可以针对某些特殊的 template arguments,对一个 class template 进行「特化」。class templates的特化与 function template 的重载类似,使你得以针对某些特... 阅读全文
posted @ 2014-05-10 16:26 剑风云 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Filter.javapackage com.bjsxt.dp.filter;public interface Filter { String doFilter(String str);}SesitiveFilter.javapackage com.bjsxt.dp.filter;public... 阅读全文
posted @ 2014-05-10 12:38 剑风云 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 思路:先把1~10000数经过多少次变换的1存入count[MAX_N]数组中,比如count[1]=1就表示1经过一次变换,count[2]=2就表示2经过了2次变换,count[i]=k表示i经过了k次变换。因为输入时m,n谁大谁小不定,所以可以先得到m,n的最大,最小数,然后在求[min(m,... 阅读全文
posted @ 2014-05-10 09:16 剑风云 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 本例之通过Action调Service,Service掉Dao实现(主要掌握思想,注意Date的注入,以及javaBean的前台显示)StudentAction-->StudentService-->StudentDao-->StudentStudent.javapackage cn.itcast.... 阅读全文
posted @ 2014-05-09 21:40 剑风云 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 康托展开X=an*(n-1)!+an-1*(n-2)!+...+ai*(i-1)!+...+a2*1!+a1*0! 其中,a为整数,并且0#includeint const MAX_N=12;int const a[MAX_N]={0,1, 2 ,6 ,24 ,120 ,720 ,5040 ,403... 阅读全文
posted @ 2014-05-09 19:58 剑风云 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Class Templates类别模板就像上一章所说的 functions 那样,classes 也可以针对一或多个类型被参数化。用来管理「各种 不同类型的元素」的 container classes(容器类别)就是典型例子。运用 class templates 你可以实 作出可包容各种类型的 co... 阅读全文
posted @ 2014-05-09 16:44 剑风云 阅读(261) 评论(0) 推荐(0) 编辑
摘要: max.hpp/* The following code example is taken from the book * "C++ Templates - The Complete Guide" * by David Vandevoorde and Nicolai M. Josuttis, Add... 阅读全文
posted @ 2014-05-09 16:28 剑风云 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 为什么使用 Templates?C++ 要求我们使用各种特定类型(specific types)来声明变量、函数和其它各种实体(entities); 然而,很多用以处理「不同类型之数据」的程序代码看起来都差不多。特别是当你实作算法(像是quicksort),或实作如 linked-list 或 bi... 阅读全文
posted @ 2014-05-09 15:56 剑风云 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includeusing namespace std;const int M=1000;int main(){ string china; int a[M]={-1},b[M]={-1},i,indexa,indexb,len,m; ... 阅读全文
posted @ 2014-05-08 17:12 剑风云 阅读(187) 评论(0) 推荐(0) 编辑