#include
#include
#include
#define N 10000001
using namespace std;
char s[N],s1[N];
int next[N];
void getnext(char s1[])
{
int j=-1,i=0,len;
next[0]=-1;
len=strlen(s1);
while(i<len)
{
if(j==-1|...
分类:
其他好文 时间:
2014-10-19 14:22:00
阅读次数:
175
1、 sizeof:
sizeof(...),是一个运算符,定义为unsigned in类型,其大小在编译期间决定的,参数可以是基本数据类型、数组、指针、对象、函数等。
功能:获得保证能容纳实现所建立的最大对象的字节大小。
数组:数组所占空间字节数:
指针:存储该指针所用的空间大小
对象:该对象所占内存空间大小
二、strlen:
strlen(...)是...
分类:
其他好文 时间:
2014-10-19 00:04:52
阅读次数:
215
【题意简述】:题意很简单。看例子就能理解
【分析】:略。字符串的读取操作。
// 200K 0Ms
#include
using namespace std;
int main()
{
char a[256];
while(1)
{
int sum = 0;
gets(a);
if(strcmp(a,"#")==0) break;
int len = strlen(a)...
分类:
其他好文 时间:
2014-10-18 22:25:18
阅读次数:
200
if (strlen($_POST[‘password‘])){ ??????????????? $password = trim($_POST[‘password‘]); ??????????????? $salt = rand(111111, 999999); ??????????????? ...
分类:
其他好文 时间:
2014-10-17 22:05:27
阅读次数:
180
这道题目的意思是给定一个字符串,作为源字符串,之后给出其他的字符串,确定源字符串是否能够经过旋转而得到给定的字符串,即移位包含问题。 假如,给定一个字符串 abcdefg,接着给定字符串 cdefgab,很显然,给定的字符串是可以经过源字符串旋转而得到的,但是,给定字符串 cdegfab 就不能由源字符串经过旋转而得到。 当然,这道题有很多解法,我们可以经过判断字符串中字符的位...
分类:
其他好文 时间:
2014-10-17 20:35:50
阅读次数:
137
int GetFindStrCount(char* src, char* find) { ? int count = 0; ? char* position =src; ? int findLen = strlen(find); ? while((position = strstr(position, find)) != NULL) { ? count++; ? position...
分类:
其他好文 时间:
2014-10-16 22:13:33
阅读次数:
214
#include#include#includeint main(void){ char a[1000]; scanf("%s",a); printf("%s->",a); for(;;) { int len=strlen(a); int i,j,old=atoi(a); for(i=0;ia[j....
分类:
其他好文 时间:
2014-10-16 09:09:32
阅读次数:
151
常用函数如下:strlen 求字符串长度strcmp 比较2个字符串是否一样strcat 字符串连接操作strcpy 字符串拷贝操作strncat 字符串连接操作(前n个字符)strncpy 字符串拷贝操作(前n个字符)strchr ...
分类:
编程语言 时间:
2014-10-14 20:21:49
阅读次数:
182
1 class Solution { 2 public: 3 bool isPalindrome(string s) { 4 int strLen = s.size(); 5 int pos_h = 0; 6 int pos_t = 0; 7...
分类:
其他好文 时间:
2014-10-14 17:21:39
阅读次数:
129
01,Android ADT 在线更新的URL: https://dl-ssl.google.com/android/eclipse/ ? 02,Lua中字符串长度的判断可以使用?? # local?str?=?"abcabc"
print(#str)?--6
print(#"abcabc")?--6 14-10-14...
分类:
Web程序 时间:
2014-10-14 16:13:59
阅读次数:
173