上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页
摘要: class Solution {public: int titleToNumber(string s) { int len = s.length(); if(len == 0) { return 0; } retur... 阅读全文
posted @ 2015-01-27 23:59 卖程序的小歪 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int trailingZeroes(int n) { int count = 0; while (n) { count += n / 5; n /= 5; }... 阅读全文
posted @ 2015-01-27 23:53 卖程序的小歪 阅读(114) 评论(0) 推荐(0) 编辑
摘要: select if(count(salary) = 0, NULL, salary) as `salary` from (select salary from Employee group by salary order by salary desc limit 1,1) tmpWrite a S... 阅读全文
posted @ 2015-01-23 00:36 卖程序的小歪 阅读(255) 评论(0) 推荐(0) 编辑
摘要: SELECT FirstName, LastName, City, State FROM Person pLEFT JOIN Address a ON p.PersonId = a.PersonId居然出SQL的题目了,左连接就行 阅读全文
posted @ 2015-01-23 00:09 卖程序的小歪 阅读(188) 评论(0) 推荐(0) 编辑
摘要: class BSTIterator {private: TreeNode* current; stack nodeStack;public: BSTIterator(TreeNode *root) { current = root; } /** @retu... 阅读全文
posted @ 2015-01-23 00:04 卖程序的小歪 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 使用引号包裹变量在《高级Bash脚本编程指南》中的4.1节中有这么个例子:hello="A B C D"echo $hello # A B C Decho "$hello" # A B C D当时觉得不可思议,对于第二个echo应该是非常好理解的,而第一个echo为什么会把原来变量中... 阅读全文
posted @ 2015-01-21 13:41 卖程序的小歪 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 可以使用readlink命令必须加上-f参数,readlink用于读取链接文件所指向的文件,这样对于一些建立了软连接的脚本文件的话非常适用,而对于一般的脚本文件需要加上-f参数否则readlink文件不会有输出(如果不加-f参数对一个普通文件适用readlink命令则$?=1)获取当前执行脚本文件路... 阅读全文
posted @ 2015-01-21 11:29 卖程序的小歪 阅读(865) 评论(0) 推荐(0) 编辑
摘要: 一、数组声明:int[] x;int x[];在Java中一般使用前者,机把int[]看做一个类型,C++中只能后者二、数组初始化:直接提供值:int[] x = {1, 3, 4};int[][] y = { {1, 2, 3}, ... 阅读全文
posted @ 2015-01-16 22:00 卖程序的小歪 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 在SQL中使用count()好像是非常自然的事情:SELECT COUNT(*) FROM TABLE_NAME;有时候确实会想过,count(*)和单独的count(column_name)有什么区别,会不会后者效率更好(太拿衣服。。。),不过一直没有去追究。Chapter 6:Query Per... 阅读全文
posted @ 2015-01-15 16:56 卖程序的小歪 阅读(331) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std;templateT mul(T a, P b) { return a * b;}templatestring mul(string a, int b) { string res; for ... 阅读全文
posted @ 2014-12-23 15:22 卖程序的小歪 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页