Restore IP AddressesGiven a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"255255...
分类:
其他好文 时间:
2015-01-03 11:49:35
阅读次数:
178
多说无益,直接看代码。public class MyTest { public static void main(String[] args) { Test t1 = new Test(); System.out.println("------------")...
分类:
编程语言 时间:
2015-01-03 10:40:57
阅读次数:
165
重载应该叫overload,重写叫override;重载某个方法是在同一个类中发生的!重写是在子类中重写父类中的方法。1.override: 父类:public virtual string ToString(){return "a";} 子类:public override string ToSt...
现在都用宽字节(unicode)了,所以建议使用wstring取代string(ansi版)不像CString一样有Format函数去转换,string/wsting类型需要手动转换#include #include using namespace std;using std::endl;using...
分类:
其他好文 时间:
2015-01-03 10:35:13
阅读次数:
262
Description
输出n个字符串,把其中以字母A打头的字符串输出。
Input
第一行 n
第二行到第n+1行,每行一个字符串
Output
A打头的字符串
Sample Input
3
Ada
Bob
Alice
SampleOutput
Ada
Alice
代码如下:
#include
#include
using namespac...
分类:
其他好文 时间:
2015-01-03 09:26:56
阅读次数:
270
昨天撸代码的时候发现了一个问题就是类型的转换,当时我的是从string转化为int型,然后试了(int)这种强制类型转化!
Doesn't work!
我擦!居然不行?!好吧,正常情况是,就是不行~
肿么办?找到了一个神器!stringstream,这个类是最近才加到编译器里面去的。所以想用这个的童鞋先升级IDE哈!
好吧,废话那么多!直接说使用方法吧!
网上给的都是用
strings...
分类:
其他好文 时间:
2015-01-03 09:26:14
阅读次数:
151
https://oj.leetcode.com/problems/n-queens/http://blog.csdn.net/linhuanmars/article/details/20667175publicclassSolution{
publicList<String[]>solveNQueens(intn){
List<String[]>result=newArrayList<>();
int[]qcols=newint[n];
solve(n,0,qcols,r..
分类:
其他好文 时间:
2015-01-03 08:14:06
阅读次数:
214
QUESTIONGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... ...
分类:
其他好文 时间:
2015-01-03 08:10:42
阅读次数:
166
Longest Palindromic Substring
Question
Solution
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists...
分类:
其他好文 时间:
2015-01-03 00:57:31
阅读次数:
272
JAVA中用于处理字符串常用的有三个类:java.lang.String、java.lang.StringBuffer、java.lang.StringBuilder,这三者的共同之处都是final类,不允许被继承,这主要是从性能和安全性上考虑的,因为这几个类都是经常被使用着的,且考虑到防止其中的参...
分类:
编程语言 时间:
2015-01-02 22:20:12
阅读次数:
279