在定义函数时,我们一般使用下面这两种方法:使用函数声明定义:123function sum 
(a, b) {return a + b;}使用函数表达式定义:123var sum = function (a, b) {return a + 
b;}调用方法都是一样的:如求“1+1”等于几:1alert(...
                            
                            
                                分类:
编程语言   时间:
2014-05-23 23:43:04   
                                阅读次数:
442
                             
                    
                        
                            
                            
                                题意:每次筛三个骰子面分别为k1,k2,k3,如果三个骰子的值分别为a,b,c则得分置0,否则得到分数加上三个骰子的值的和,如果得分大于等于n则结束游戏。设E[i]表示当前得到i分时结束游戏的期望。则E[i]=sum{Pk*(E[i+k]+1)|k为三个骰子可能取得的分数且不包括a,b,c这种情况}...
                            
                            
                                分类:
其他好文   时间:
2014-05-23 11:48:09   
                                阅读次数:
303
                             
                    
                        
                            
                            
                                MSS(Array[],N)//Where N is the number of 
elements in array{sum=0; //current summax-sum=0;//Maximum Sumseq-start=0;//start 
of the subsequenceseq-end=0;...
                            
                            
                                分类:
其他好文   时间:
2014-05-23 11:03:58   
                                阅读次数:
221
                             
                    
                        
                            
                            
                                http://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/清单 5. 使用 
yield 的第四版 def fab(max): n, a, b = 0, 0, 1 while n >> for n in fab...
                            
                            
                                分类:
编程语言   时间:
2014-05-20 13:45:03   
                                阅读次数:
319
                             
                    
                        
                            
                            
                                #include#include#include#define max 10int 
dp[max][3];int number[max];//dp[i][0] 前i位数中不符合要求的总个数//dp[i][1] 
前i位数中最高位是2的个数//dp[i][2] 前i位数中存在含4和有连续62的个数voi...
                            
                            
                                分类:
其他好文   时间:
2014-05-20 13:24:39   
                                阅读次数:
252
                             
                    
                        
                            
                            
                                戳我去解题Given two binary strings, return their sum 
(also a binary string).For example,a ="11"b 
="1"Return"100".分析:高精度加法,只是将10进制的高精度加法 换成了 2进制的高精度加法首先将 两个...
                            
                            
                                分类:
其他好文   时间:
2014-05-20 11:21:52   
                                阅读次数:
224
                             
                    
                        
                            
                            
                                戳我去解题Given a non-negative number represented as an 
array of digits, plus one to the number.The digits are stored such that the most 
significant digit ...
                            
                            
                                分类:
其他好文   时间:
2014-05-20 10:42:14   
                                阅读次数:
244
                             
                    
                        
                            
                            
                                模和除题目描述两个整数x和y,满足1#includeint main(){ __int64 
a,b,sum,c; __int64 i,j,temp; while(scanf("%I64d%I64d",&a,&b)!=EOF) { 
sum=0; if...
                            
                            
                                分类:
其他好文   时间:
2014-05-20 10:17:49   
                                阅读次数:
313
                             
                    
                        
                            
                            
                                先上代码:Xor SumTime Limit: 2000/1000 MS 
(Java/Others)Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 
7837Accepted Submission(s): 3350Prob...
                            
                            
                                分类:
其他好文   时间:
2014-05-20 09:36:48   
                                阅读次数:
271
                             
                    
                        
                            
                            
                                Group 
By/Having操作符适用场景:分组数据,为我们查找数据缩小范围。说明:分配并返回对传入参数进行分组操作后的可枚举对象。分组;延迟1.简单形式:var q = 
from p in db.Products group p by p.CategoryID into g select g;语...
                            
                            
                                分类:
数据库   时间:
2014-05-20 07:48:14   
                                阅读次数:
531