由于C语言中只提供了一个char类型用来处理字符,对于字符串的处理,我们往往都是通过字符数组来处理的,这有些时候还是很不方便的。其实vector就和char类型的数组很像,vector就是字符串类型的数组了。 1.1 创建一个string类型的对象 下面的代码创建了一个字符串对象s,且s是一个...
分类:
其他好文 时间:
2015-04-06 06:15:54
阅读次数:
178
Pre x goodness of a set string is length of longest common pre x*number of strings in the set. For
example the pre x goodness of the set f000,001,0011g is 6.You are given a set of binary strings. Fin...
分类:
其他好文 时间:
2015-04-06 01:07:22
阅读次数:
178
namespace 自己琢磨推箱子{ class Program { static void Main(string[] args) { //定义一个地图 int x=2,y=1;//小人的位置 int temp = 0; int[,] map = new int[10, 10] { {1,1,.....
分类:
其他好文 时间:
2015-04-06 00:55:30
阅读次数:
220
Javapublic class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); }}JavaScriptTo write to a con...
分类:
其他好文 时间:
2015-04-05 23:25:29
阅读次数:
216
1.TextView
TextView可以说是Android中最简单的一个控件了。它主要用于在界面上显示一段文字信息。
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/he...
分类:
移动开发 时间:
2015-04-05 22:01:33
阅读次数:
213
Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
...
分类:
其他好文 时间:
2015-04-05 22:00:12
阅读次数:
127
/*编写一个函数reverse_string(char * string)(递归实现)
实现:将参数字符串中的字符反向排列。
要求:不能使用C函数库中的字符串操作函数。*/
#include
#include
void reverse_string(char const * string)
{
assert( string != NULL );
if( *string != '\0' ...
分类:
编程语言 时间:
2015-04-05 21:58:58
阅读次数:
155
闰年的计算方法为:四年一闰,百年不闰,四百年再闰。基于闰年的计算方法用程序来实现为:1.bool isLeapYear( int year ){ return (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);} 2.bool isLeap...
分类:
其他好文 时间:
2015-04-05 21:55:15
阅读次数:
131
今天清明,再补一篇Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating l...
分类:
其他好文 时间:
2015-04-05 21:54:11
阅读次数:
134