#include #include #include #include #include using namespace std; #pragma comment(lib, "winmm.lib") int StringCompare(){ string strSource = "hello wor...
分类:
其他好文 时间:
2016-01-06 11:55:38
阅读次数:
163
#define _CRT_SECURE_NO_WARNINGS#include#includevoid strcom(char *str1 , char *str2,int *num){ int a = 0; int count = 0; //关键在这里 用指针进行循环推断 while (*str1...
分类:
其他好文 时间:
2016-01-02 16:21:40
阅读次数:
176
一个容易疏忽的问题:strcmp、strncmp、memcmp,对于memcmp进行字符串比较时可能会出现内存重叠的情况status = strncmp(xdev->product, "MU709", 5);if (!status) { return -ENODEV;}一个脚本,用来通过xcb方式下...
分类:
其他好文 时间:
2015-12-23 17:43:44
阅读次数:
128
题目传送门题意:询问所有字符串的比较次数和(注意for循环内的比较也算)分析:将所有字符串插入到字典树上,然后结点信息记录有几个字符串,那么每走到一个结点就能知道比较到此时需要的次数。学习到链表存结点#include using namespace std;typedef long long ll;...
分类:
其他好文 时间:
2015-12-19 20:33:28
阅读次数:
211
今天学习了c语言的一些库函数用法。比如:strcpy(),strlen(),strchr(),strcmp(),strcat(),strstr()。下面是我写的一些代码和结果。1.strlen#include<stdio.h>
#include<string.h>
intmain()
{
chara[10]="12345";
printf("%d\n",strlen(a));
system("pause");
r..
分类:
其他好文 时间:
2015-12-18 19:08:24
阅读次数:
174
1, strcmpstrcmp() 用来比较字符串(区分大小写),其原型为: int strcmp(const char *s1, const char *s2);【返回值】若参数s1 和s2 字符串相同则返回0。s1 若大于s2 则返回大于0 的值。s1 若小于s2 则返回小于0 的值。
分类:
其他好文 时间:
2015-12-17 15:58:59
阅读次数:
122
Action(){/**********************************Author:旺仔*object:strcmp*date:2015-12-09*fuc:我输入一个网址,网址中包含若干参数(ID、password),网址提交后IE返回登录结果(A\X\Z\D);返回A代表登录成...
分类:
其他好文 时间:
2015-12-17 13:03:03
阅读次数:
172
#include<stdio.h>intmain(){charstr1[20]={"hello"};charstr2[]={"bit"};printf("%s",strcat(str1,str2));system("pause");return0;}#include<stdio.h>intmain(){charstr1[20];charstr2[]={"bit"};printf("%s",strcpy(str1,str2));system("pause");return0;}#incl..
分类:
其他好文 时间:
2015-12-16 17:30:15
阅读次数:
218
#include<stdio.h>#include<windows.h>#include<string.h>intmain(){char*p="112233";charpasswd[10];inti=0;for(i=0;i<3;i++){printf("输入密码\n");scanf("%s",passwd);if(strcmp(p,passwd)==0){break;}else{printf("密码错误\n");}}if(i==3){printf("..
分类:
其他好文 时间:
2015-12-09 20:04:20
阅读次数:
145
尽量避免二次循环,很容易运行超时。该算法用printf 用时30ms 使用cout 运行75ms,只差这一句话。所以输出很多的时候不应该使用coutg++ 编译器使用 strcmp 一定要引用 string.h 头Programming Ability Test (PAT) is organized...
分类:
其他好文 时间:
2015-12-06 11:22:37
阅读次数:
201