摘要: 1 class Solution { 2 public: 3 void reverseWords(string &s) { 4 string end="",tem=""; 5 char *p=&s[0]; 6 whil... 阅读全文
posted @ 2014-11-27 21:52 xcw0754 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 int removeDuplicates(int A[], int n) { 4 int *s=&A[0],*e=&A[0]; //s指向“连续数字”的第一个,e往后遍历相同的 5 int ... 阅读全文
posted @ 2014-11-27 17:03 xcw0754 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 int lengthOfLastWord(const char *s) { 4 if(s=="") return 0; 5 string snew=s; 6 int n=0,... 阅读全文
posted @ 2014-11-27 16:10 xcw0754 阅读(150) 评论(0) 推荐(0) 编辑