字符串相加的时候尽量使用:join ????在while True 循环的时候,尽量使用:while 1 ????字符串处理: ????????分组 str.split(‘key‘) ????????列表翻转:list.reverse()...
分类:
编程语言 时间:
2014-07-29 16:17:09
阅读次数:
176
Text Reverse
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 16342 Accepted Submission(s): 6205
Problem Description
Ignatius lik...
分类:
其他好文 时间:
2014-07-29 13:22:27
阅读次数:
212
解法: 1 class Solution { 2 public: 3 int reverse(int x) { 4 int signal = (x>0)? 1:-1; /* signal记录正负号 */ 5 x=abs(x); 6 int ...
分类:
其他好文 时间:
2014-07-29 11:25:06
阅读次数:
197
class Solution {public: ListNode *reverseKGroup(ListNode *head, int k) { if (k next = rhead; } last = rtail; } ...
分类:
其他好文 时间:
2014-07-28 11:22:20
阅读次数:
227
LeetCode: Reverse Words in a StringGiven an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky...
分类:
其他好文 时间:
2014-07-27 23:33:19
阅读次数:
173
LeetCode: Reverse Words in a String:Evaluate Reverse Polish NotationEvaluate the value of an arithmetic expression in Reverse Polish Notation.Valid op...
分类:
其他好文 时间:
2014-07-27 23:32:59
阅读次数:
262
java实现的字符串翻转,能想到的这几种方法
如果有其他方法,欢迎交流
//字符串反转
public class ReverseString {
public String reverse1(String str){
StringBuffer sb = new StringBuffer(str);
str = sb.reverse().toString();
return str...
分类:
其他好文 时间:
2014-07-27 11:09:12
阅读次数:
211
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1062解题报告:注意一行的末尾可能是空格,还有记得getchar()吃回车符。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #incl...
分类:
其他好文 时间:
2014-07-27 10:12:02
阅读次数:
149
Reverse Words in a String考虑几个特殊的情况1.若字符窜s=" "2.字符窜s=“a b d e”3.字符窜s=“ a”class Solution {public: void reverseWords(string &s) { int i; int c...
分类:
其他好文 时间:
2014-07-26 17:03:01
阅读次数:
360
[cpp] view plaincopytemplatevoidreverse(BidirectionalIteratorfirst,BidirectionalIteratorlast);[cpp] view plaincopy如果不是改变原来的容器,而是翻转之后放在新容器里面,直接用reverse...
分类:
编程语言 时间:
2014-07-26 16:59:21
阅读次数:
394