最近做一个小程序,读取本地指定路径下的text文件,逐行获取text文本然后再进行处理,结果遇到了一个奇葩问题,先插个图片给各位看官 坑:本地text文件中数据为1123/10(数据反复检查无空格,换行之类),经过截取后,str1=1123 str2=10,可是打印结果显示str1.length() ...
分类:
其他好文 时间:
2017-06-02 15:48:42
阅读次数:
238
#include using namespace std; #include"set" #include"algorithm" struct compareNoCase { //bool operator()(const string &str1, const string &str2) 这种居然是... ...
分类:
其他好文 时间:
2017-06-01 21:02:22
阅读次数:
160
Input 第一行为一个整数T,表示数据的组数 一下T行 每行一个八进制数字串s 一下T行 每行一个八进制数字串s Output 对于每组数据输出对应的十六进制字串 Sample Input 47772332333333333333333333 Sample Output 73F9B9B6DB6DB ...
分类:
其他好文 时间:
2017-05-31 20:52:05
阅读次数:
201
#include<stdio.h> #include<string.h> /* char s1[]="I am a student"; char s2[20]="teacher"; char s3[]="student"; int result; char s4[20],*p; 1.串的长度 int ...
分类:
编程语言 时间:
2017-05-31 10:16:59
阅读次数:
184
Longest Common Substring Problem Description Given two strings, you have to tell the length of the Longest Common Substring of them.For example:str1 = ...
分类:
其他好文 时间:
2017-05-30 23:11:55
阅读次数:
326
problem: Write a function to find the longest common prefix string amongst an array of strings. 寻找 0 ~n 个字符串的最长公共前缀 thinking: (1)公共前缀非常好理解。按位匹配就可以 (2) ...
分类:
其他好文 时间:
2017-05-30 16:12:58
阅读次数:
221
PostgreSQL 支持hstore 来存放KEY->VALUE这类数据, 事实上也相似于ARRAY或者JSON类型。 要高效的使用这类数据,当然离不开高效的索引。我们今天就来看看两类不同的索引对于同一种检索请求的性能问题。假如我们有这样一个原始表。基于str1字段有一个BTREE索引。t_gir ...
分类:
数据库 时间:
2017-05-30 15:44:42
阅读次数:
204
提示:该文章是整理别人别人的文章,作者比较多,很难分辨原创作者是谁。 1)使用!!将变量转换成布尔类型 有时,我们需要检查一些变量是否存在,或者它是否具有有效值,从而将他们的值视为true。对于这样的检查,你可以使用!!(双重否定运算符),他能自动将任何类型的数据转化为布尔值,只有0、null、“” ...
分类:
编程语言 时间:
2017-05-28 00:26:38
阅读次数:
313
按esc进入命令模式 1.替换 :%s/str1/str2/g 替换每一行中所有str1为str2 :s/str1/str2/g 替换当前行中所有str1为str2 :n1,n2s/str1/str2/g 替换n1行到n2行中所有str1为str2 备注:去掉/g即表示只替换匹配到的第一个str1为 ...
分类:
系统相关 时间:
2017-05-24 23:54:00
阅读次数:
239
MySQL中concat函数 CONCAT(str1,str2,…) 1 .两个或多个字段连接 例:字段 a,b 表 tb1 语句: select concat(a,b) from tb1 2.字段和已有字符串连接 例: 字段 a 字符串 "bb" 表 tb2 语句: select concat(a ...
分类:
数据库 时间:
2017-05-24 10:13:31
阅读次数:
437