String 内容定义成 final char[],只能在属性和构造函数中赋值,其它地方不能改变 ;String 覆盖实现了 equals 。StringBuffer 内容定义成了 char[] ,但没实现 equals。String 和 StringBuffer 的区别是:1、String 通过构...
分类:
编程语言 时间:
2014-07-01 23:32:09
阅读次数:
266
--1.数据类型不同。 --sql server 的数据类型:int ,smallint ,char,varchar,nchar,nvarchar,ntext,datetime,smalldatetime,money,decima, --float,bit…… --oracle ...
分类:
数据库 时间:
2014-07-01 22:59:14
阅读次数:
341
C 结构体小结关于结构体的声明:# include //第一种方式struct Student{ int age; float score; char sex;};//第二种方式struct Student2{ int age; float score; char...
分类:
其他好文 时间:
2014-06-30 23:18:58
阅读次数:
336
C 语言标准库函数原型声明:extern char *strcpy(char* dest, const char *src);头文件:#include 功能:把从src地址开始且含有NULL结束符的字符串复制到以dest开始的地址空间说明:src和dest所指内存区域不可以重叠且dest必须有足够的...
分类:
其他好文 时间:
2014-06-30 22:45:02
阅读次数:
340
题目连接:Codeforces 442B Kolya and Tandem Repeat
题目大意:给出一个字符串,可以再添加n个字符,问说可以找到SS的子串形式,S尽量长。
解题思路:枚举长度和起点判断即可,超过len的可以作为任意值,但是超过len+n就不行了。
#include
#include
const int N = 205;
int n, len;
char s...
分类:
其他好文 时间:
2014-06-30 20:21:48
阅读次数:
220
源程序:
#include
#include
using namespace std;
int main()
{
int n;char buffer[6];
int count=0;
int len;
cin>>n;
for(int i=1;i<=n;i++)
{
if((i%7)==0)count++;
else
{
itoa(i,buffer,10);
...
分类:
其他好文 时间:
2014-06-30 20:16:38
阅读次数:
246
#include
#include
#include
typedef struct{
char a;//记录对应字符
int weight;//权值
int parent,lchild,rchild;
}HTNode,*HuffmanTree;
typedef char * *HuffmanCode;//动态分配数组存储哈夫曼编码表
void Select(H...
分类:
其他好文 时间:
2014-06-30 19:21:16
阅读次数:
205
下面这个散列表的实现来自K&R,很经典。在其他场景中遇到的实现更复杂,基本原理不变,只是在hash算法,或者在快速查询上做了优化。
#include
#include
//具有相同hash值构成的链表
struct nlist{
struct nlist
* next;
char * name; //key-定义的名字
char ...
分类:
其他好文 时间:
2014-06-30 19:08:53
阅读次数:
209
#include
#include
#include
static char out_ip[15] = "52.0.10.188";
static int out_port = 8888;
int main()
{
char sSendBuf[2049], sRecvBuf[2049];
int connfd = 0, iRet = 0, iSend...
分类:
其他好文 时间:
2014-06-30 18:56:37
阅读次数:
247