摘要: public ListNode addTwoNumbers(ListNode l1, ListNode l2) { if(null == l1){ return l2; } if(null == l2){ return l1; } // part 1两个list都有值的部分 ListNode fro 阅读全文
posted @ 2016-02-08 16:37 持幕 阅读(1142) 评论(0) 推荐(0) 编辑
摘要: public String multiply(String num1, String num2) { int[] num1IntArr = toIntArr(num1); int[] num2IntArr = toIntArr(num2); if (num1IntArr.length == 0 || 阅读全文
posted @ 2016-02-08 16:35 持幕 阅读(181) 评论(0) 推荐(0) 编辑
摘要: eclipse版本: Indigo Service Release 1OS版本:window 7 旗舰版python版本:2.7现象:通过eclipse自动安装pydev,安装没有任何问题,但安装之后window->Preferences没有显示PyDev。下载最新的Pydev离线安装,打开eclipse同样没有显示DyDev。Google一通之后发现,PyDev3.0以后都需要Java7(Eclipse 3.7 onwards and Java 7)。如果你运行的是Java6,请使用PyDev2.x下载PyDev2.x http://sourceforge.net/projects/p 阅读全文
posted @ 2014-04-02 10:56 持幕 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 写一个函数: int print_num(int k){}; 要求函数功能为打印k的降序,直到0结束,即如果k=5,即打印: 5 4 3 2 1 0 要求: 不能用 if , if else, switch, ?: , while, for , do while, goto 语句解法1:利用构造函数和数组 1 class Printer 2 { 3 public: 4 static int counter; 5 Printer() 6 { 7 cout<<counter<<endl; 8 counter--; 9 } 10 }; 11 int P... 阅读全文
posted @ 2012-08-26 16:16 持幕 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1 #include <unistd.h>; 2 #include <sys/types.h>; 3 4 main () 5 { 6 pid_t pid; 7 pid=fork(); // 这个地方开始分化为两个进程空间(所谓的一次调用,两个返回) 8 9 if (pid < 0)10 printf("error in fork!");11 else if (pid == 0)12 printf("i am the child process, m... 阅读全文
posted @ 2012-08-26 15:49 持幕 阅读(123) 评论(0) 推荐(0) 编辑