1)字符串操作strcpy(p,p1)复制字符串strncpy(p,p1,n)复制指定长度字符串strcat(p,p1)附加字符串strncat(p,p1,n)附加指定长度字符串strlen(p)取字符串长度strcmp(p,p1)比较字符串strcasecmp忽略大小写比较字符串strncmp(p...
分类:
编程语言 时间:
2014-10-14 13:52:58
阅读次数:
207
A + B
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12153 Accepted Submission(s): 7103
Problem Description
读入两个小于100的正整数A和B,计算A+B....
分类:
其他好文 时间:
2014-10-13 18:41:40
阅读次数:
166
Problem Description
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resultin...
分类:
其他好文 时间:
2014-10-12 19:46:59
阅读次数:
205
HDU 5059 Help him
题目链接
直接用字符串去比较即可,先判断原数字正确不正确,然后写一个判断函数,注意细节,然后注意判掉空串情况
代码:
#include
#include
const int N = 105;
char n[N], a[N], b[N];
bool judge(char *str) {
int len = strlen(str);...
分类:
其他好文 时间:
2014-10-12 00:47:27
阅读次数:
294
??
1、什么是sizeof
首先看一下sizeof在msdn上的定义:
The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type (including aggregate types). This keyword returns a value...
分类:
其他好文 时间:
2014-10-11 11:06:15
阅读次数:
239
1 int BFMatch(char *s,char *p) 2 { 3 int i,j; 4 i=0; 5 while(i<strlen(s)) 6 { 7 j=0; 8 while(s[i]==p[j]&&j<strlen(p))...
分类:
其他好文 时间:
2014-10-10 23:39:04
阅读次数:
302
转自:http://blog.chinaunix.net/uid-24194439-id-90782.htmlstrcat 原型:extern char *strcat(char *dest,char *src); 用法:#include 功能:把src所指字符串添加到dest结尾处(覆盖d...
分类:
其他好文 时间:
2014-10-10 12:56:54
阅读次数:
149
voidreverse(char*str){if(str==NULL)return;intlen=strlen(str);inti=0;chartmp;for(i=0;i<len/2;i++){tmp=*(str+i);*(str+i)=*(str+len-1-i);*(str+len-1-i)=t...
分类:
其他好文 时间:
2014-10-09 16:13:34
阅读次数:
171
#include#includeusing namespace std;/*用最小表示法求字符串S的最小字典序返回字典序最小的串的首字母位置*/int minstr(char s[]){ int len=strlen(s); int i=0,j=1; while(i=len) ...
分类:
其他好文 时间:
2014-10-09 15:09:54
阅读次数:
126
char*newstr(char*str){if(str==NULL)returnNULL;intblank=0;intlen=strlen(str);inti=0;for(i=0;i<len;i++)if(str[i]=='')blank++;intj=0;char*newhead=newchar...
分类:
其他好文 时间:
2014-10-09 14:43:28
阅读次数:
243