原题地址用栈保存化简后的路径。把原始路径根据"/"切分成若干小段,然后依次遍历若当前小段是"..",弹栈若当前小段是".",什么也不做否则,入栈代码: 1 string simplifyPath(string path) { 2 vector buffer; 3 char *tok = NU...
分类:
其他好文 时间:
2015-01-25 18:09:35
阅读次数:
138
NSString是一个不可变的字符串对象。这不是表示这个对象声明的变量的值不可变,而是表示它初始化以后,你不能改变该变量所分配的内存中的值,但你可以重新分配该变量所处的内存空间。生成一个NSString类型的字符串有三种方法:方法1.直接赋值: NSString*str1 =@"my string"...
分类:
其他好文 时间:
2015-01-25 18:06:09
阅读次数:
128
1.使用逗号分割金额String.prototype.strReverse = function() { return this.split('').reverse().join('');}function amountSplit(amount) { return amount.toSt...
分类:
编程语言 时间:
2015-01-25 17:54:28
阅读次数:
142
private static string connStr { get { SqlConnectionStringBuilder sb = new SqlConnectionStringBuilder(); ...
分类:
数据库 时间:
2015-01-25 17:53:13
阅读次数:
167
private void button1_Click(object sender, EventArgs e) { //连接数据库 string sqls = "server=.;database=schoolData;user=sa;pwd=";//.本机的地址,数据库的文件名,sa:登录用户名 ....
分类:
数据库 时间:
2015-01-25 17:52:34
阅读次数:
192
题目:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are...
分类:
其他好文 时间:
2015-01-25 16:44:04
阅读次数:
136
题目:
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
...
分类:
编程语言 时间:
2015-01-25 16:41:55
阅读次数:
201
1 public class HelloWorld{2 public static void main(String[] args) {3 System.out.println("Hello World!");//输出Hello World!4 }5 }publ...
分类:
编程语言 时间:
2015-01-25 16:24:14
阅读次数:
200
/*题目一大堆,其实意思就是长度为n个二进制数,里面有h个1,将这个二进制数进行全排列,然后输出*/#include"iostream"#include"algorithm"#include"stdio.h"#include"string.h"#include"cmath"#include"queu...
分类:
其他好文 时间:
2015-01-25 15:09:52
阅读次数:
156
这道题DFS,BFS,并查集好像都可以觉得深搜跟并查集可能会更简单一些 1 #include "iostream" 2 #include "algorithm" 3 #include "memory.h" 4 #include "cmath" 5 #include "string" 6 using ...
分类:
其他好文 时间:
2015-01-25 15:05:19
阅读次数:
192