2016年6月21日

2016.6.21——Climbing Stairs

摘要: Climbing Stairs 本题收获: 1.斐波那契函数f(n) = f(n-1) + f(n -2) 题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can eithe 阅读全文

posted @ 2016-06-21 14:52 zhuzhu2016 阅读(210) 评论(0) 推荐(0) 编辑

2016.6.21——Add Binary

摘要: Add Binary 本题收获: 对于相加而言,考虑进位以及进位之后的值为多少,全部进位完毕后进位还为1(11 + 11 = 110)需要添加一位.1.string中默认每个元素为char型 2.从int型转化为char型 s[i] - '0' 从char型转化为int型 s[i] + '0' 3. 阅读全文

posted @ 2016-06-21 14:42 zhuzhu2016 阅读(132) 评论(0) 推荐(0) 编辑

导航