定义函数模板的一般形 式为template 或 template 函数模板:函数参数个数,函数体相同.参数类型不同函数重载: 函数参数个数,类型不同.与函数类型(返回值)无关 1 #include 2 using namespace std; 3 4 template 5 T max(T a,...
分类:
编程语言 时间:
2014-07-18 19:38:03
阅读次数:
235
1. We can make it to play trick in code.At Dialog's show function, after app has set contentView, we can add a GlobalLayoutListener on decorView's Vie...
分类:
其他好文 时间:
2014-07-18 16:30:52
阅读次数:
451
分为4个步骤1:执行microtime(),获取当前的微秒数2:把获取的微秒数转换为double类型3:再用转换后的数字去乘以10000004:给随机数发生器播种,播种数为第三步得出的结果rand为生成0到RAND_MAX 之间的伪随机整数,RAND_MAX的值因平台不同而不同srand() 函数作...
分类:
其他好文 时间:
2014-07-18 08:15:14
阅读次数:
219
class Solution {private: vector sum; vector step; set can;public: int jump(int A[], int n) { step.clear(), sum.clear(), can.clear()...
分类:
其他好文 时间:
2014-07-17 18:36:56
阅读次数:
221
html:
我趣旅行网-美剧迷
Pisode
css:
html,body{
height:100%;
margin:0;
padding:0;
}
.wrapper{
position:relative;
margin: 0 auto;
max-width: 500px;
min-...
分类:
移动开发 时间:
2014-07-17 17:20:56
阅读次数:
262
学习C++ Primer Plus 的一些笔记,主要是给自己看的,记录自己学习C++的点点滴滴...
分类:
编程语言 时间:
2014-07-17 16:02:03
阅读次数:
241
在函数声明中出现的参数名,其作用范围只在 本行的括号内。实际上,编译系统对函数声明中的 变量名是忽略的,即使在调用函数时也没有为它们 分配存储单元。例如int max(int a,int b);┆int max(int x,int y){ cout<<x<<y<<endl; cout<<a<<b<<...
分类:
编程语言 时间:
2014-07-17 14:33:29
阅读次数:
209
输入两个正整数nint main(){ int n,m,i; double sum; while(~scanf("%d %d",&n,&m)) { sum=0; for(i=n;i<=m;i++) { sum+=...
分类:
其他好文 时间:
2014-07-17 14:29:32
阅读次数:
300
给出两个字符串,求它们最长的公共子字符串长度。如abfgc acbfefc最长的公共子字符串为abfc 长度为4思路:找到s1[i]与s2[j]的时候,相等的话,dp[i+1][j+1]=dp[i][j]+1; 不等的话dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j...
分类:
其他好文 时间:
2014-07-17 14:26:18
阅读次数:
218
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-07-17 14:03:41
阅读次数:
293