1 class Solution { 2 public: 3 int reverse(int x) { 4 int e,s,num,k=0; 5 num=x; 6 e=0; 7 if(x<0) 8 nu...
分类:
其他好文 时间:
2014-11-08 23:29:37
阅读次数:
326
Array.Sort(nums);//升序排序Array.Reverse(nums);//反转//冒泡排序法for(int i=0;inums[j+1]) { int temp=nums[j]; nums[j]=nums[j+1]; nums[j+1]=temp; } }}
分类:
编程语言 时间:
2014-11-08 22:03:32
阅读次数:
182
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321需要考虑:如果给出数据的逆置溢出,如何处理? 1 int reverse(int x) 2 { 3 ...
分类:
其他好文 时间:
2014-11-08 11:39:54
阅读次数:
162
题意:
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321...
分类:
其他好文 时间:
2014-11-07 23:32:17
阅读次数:
298
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2014-11-07 23:12:58
阅读次数:
238
一、简要概述whatislist?
1、用[和]括起来,用逗号间隔每个数据项
2、数据项可是同类型数据也可以是不同类型数据(数字、字符串、浮点型)
3、list里面可以有list作为其数据项
4、数据项对应的位置为索引编号(index)。默认第一个是0
5、有序的数据集合
whatisstring?
1、用单引..
分类:
编程语言 时间:
2014-11-07 19:16:46
阅读次数:
141
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex...
分类:
其他好文 时间:
2014-11-06 19:16:47
阅读次数:
178
Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the".Clarification:What constitute...
分类:
其他好文 时间:
2014-11-06 14:23:16
阅读次数:
137
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 the".代码实现...
分类:
其他好文 时间:
2014-11-05 19:15:30
阅读次数:
189
对于使用Java字符串反转有以下几种实现:利用StringBuilder类中的reverse函数;使用递归,将String的首字符放到除首字符外的子串后,然后再递归调用子串;使用字符数组做reverse;public class Reverse { public static String reve...
分类:
编程语言 时间:
2014-11-05 00:18:10
阅读次数:
189