搜索到与相关的文章
Python

python【自写】命名元组

内置方法fromcollectionsimportnamedtuplefree_falling_body=namedtuple('free_falling_body',['g','t'])h=free_falling_body(9.8,2**(1/2))print(h)#自由落体运动print(h.g*h.t**2/2)#自由落体高度free_falling_body(g=9.8,t=1.4142135623730951)9.800000000000002

系统 2019-09-27 17:45:29 2526

编程技术

【leetcode】sqrt(int x)

Question:Implementintsqrt(intx).Computeandreturnthesquarerootofx.Anwser1:二分法classSolution{public:intsqrt(intx){if(x<0)return-1;//assert(x>=0);longlongx2=(longlong)x;longlongleft=0;longlongright=x2;longlongmid=0;while(left<=right){

系统 2019-08-29 23:44:26 2526

编程技术

JSF: 动态生成的DataTable, 固定表头, 固定行