又是那种看上去非常简单,但非常难过的问题,主要是所有的测试用例很难考虑全面。下面我列举出所有的情况:
1. 字符串前面是可以含有空格的,但是全部都是空格是不行的。
2. 一个数字开头可以是哪些字符呢?很容易想到的是“+”和“-”,但是别忘记还有小数点。
3. 一个数字中间也是可以含有字符的,比如科学计数法的“e”,而且e之后是可以接“+”或者“-”的。但是要注意e是不是作为数字的开头或者结尾...
分类:
其他好文 时间:
2014-05-13 07:16:48
阅读次数:
232
在include标签中不能省略
layout_width或者layout_height否则设置layout_weight就会无效。如下设置即可
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="w...
分类:
其他好文 时间:
2014-05-13 07:12:47
阅读次数:
389
系列文章[Nhibernate]体系结构[NHibernate]ISessionFactory配置[NHibernate]持久化类(Persistent
Classes)[NHibernate]O/R Mapping基础[NHibernate]集合类(Collections)映射[NHibernat...
分类:
系统相关 时间:
2014-05-12 21:46:00
阅读次数:
454
通常的写法是select方法后跟一个blur方法,但是这里我们不能使用blur方法,应该将blur改为window.parent.document.body.focus();
分类:
其他好文 时间:
2014-05-12 19:23:37
阅读次数:
995
#include "widget.h"#include
"ui_widget.h"#include #include Widget::Widget(QWidget *parent) :
QWidget(parent), ui(new Ui::Widget) { ui->setupUi(t...
分类:
其他好文 时间:
2014-05-12 08:12:35
阅读次数:
243
1.dos工程路径下执行(c:home/trunk/src下):rubyscript/generatemigrationAddPermissionsData(名字随便起)生成时间戳文件classAddPermissionsData<ActiveRecord::Migrationdefself.upp=Permission.create({:name=>‘张三‘,:parent_id=>‘367‘,:deleted=>‘0‘,:act..
分类:
数据库 时间:
2014-05-12 03:49:00
阅读次数:
330
1、
??
Surrounded Regions
Given a 2D board containing 'X' and 'O',
capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's
in that surrounded region.
For e...
分类:
其他好文 时间:
2014-05-11 18:52:32
阅读次数:
293
Given a binary tree, determine if it is a valid
binary search tree (BST).Assume a BST is defined as follows:The left subtree of
a node contains only n...
分类:
其他好文 时间:
2014-05-11 06:46:32
阅读次数:
366
犯了很多细节上的错误,比如忽视了“-”的存在,正是因为有“-”的存在,所以不能用if
(rows.size() == i)来判断rows里面是否已经存某一行,如果不存在再row = new
ArrayList();row.add(board[i][j]);rows.add(row);来添加新的一行。...
分类:
其他好文 时间:
2014-05-10 09:06:35
阅读次数:
341
Substring时间限制:1000 ms | 内存限制:65535 KB难度:1描述You
are given a string input. You are to find the longest substring of input such
that the reversal of the ...
分类:
其他好文 时间:
2014-05-10 06:20:56
阅读次数:
257