题目:
可以点击“click to show spoilers”,查看需要考虑的问题。我是做题的时候没有查看,结果里面给出的三个注意的地方只考虑了两个,导致提交之后溢出,之后又重新考虑。
我的解决方案:
public class Solution {
public int reverse(int x) {
char[] sArray = String.va...
分类:
其他好文 时间:
2014-12-19 12:11:49
阅读次数:
181
版权所有,转载须注明出处!1、为什么要在做网络通信的时候,经常需要用到:读:就是我们需要从网络流里面读取字节数据,并且由于分包的原因,我们需要自己缓存这些数据,而不是读完立刻丢掉。写:我们需要把各种类型的数据变成字节写入。比如把int、string、short等变成字节数组写入流。2、需要什么我们需要设计一个类来实现:支持可以不停地往这个类中添加字节支持写入int、string、short等基础数...
分类:
编程语言 时间:
2014-12-19 12:08:14
阅读次数:
261
C# 6.0introduced a new operator named,nameofthat accepts the name of code element and returns a string literal of the same element. Thenameofoperator ...
分类:
Windows程序 时间:
2014-12-19 12:02:30
阅读次数:
2365
1:List转Jsonpublic static String list2JsonArray(List list) { StringBuffer str = new StringBuffer("["); if (list != null && list.size() > ...
分类:
其他好文 时间:
2014-12-19 12:02:09
阅读次数:
139
#region 3DES /// /// 3DES加密 /// /// 需加密的字符串 /// 密匙 /// public static string DES3Encrypt(string str...
分类:
其他好文 时间:
2014-12-19 12:01:26
阅读次数:
162
1、表示继承关系 class classA:classB2、继承构造,调用自己这个类的某个构造函数,因为有的类构造函数很多参数,而有的参数又不是必须填写,或者可以提供一些默认值,就跟重载是一样的道理。在调用SocketServer(string ip, int port)时,先调用this(ip,....
在python中Template可以将字符串的格式固定下来,重复利用。Template属于string中的一个类,要使用他的话可以用以下方式调用:from string import Template我们使用以下代码:>>> s = Template('There ${moneyType} is ....
分类:
编程语言 时间:
2014-12-19 11:48:52
阅读次数:
203
1. 引入:pinyin4j-1.1.0 包; http://pan.baidu.com/s/1eQ8a8742. 转换;private static String ChineseToPinyin(String name){ String pinyinName=""; c...
分类:
编程语言 时间:
2014-12-19 11:47:52
阅读次数:
196
#region RSA public static byte[] GetBytes(String num) { BigInteger n = new BigInteger(num, 10); String s =...
分类:
其他好文 时间:
2014-12-19 11:41:57
阅读次数:
155
/// /// Xml序列化与反序列化 /// public class XmlUtil { public static string GetRoot(string xml) { XmlDocument doc =...
分类:
其他好文 时间:
2014-12-19 11:38:50
阅读次数:
123