随笔分类 -  字符串

摘要:函数名: strcpy 功 能: 拷贝一个字符串到另一个 用 法: char *strcpy(char *destin, char *source); 程序例: #include <stdio.h> #include <string.h> int main(void) { char string[1 阅读全文
posted @ 2016-04-04 18:29 龙杉老师
摘要:1)字符串操作 strcpy(p, p1) 复制字符串 strncpy(p, p1, n) 复制指定长度字符串 strcat(p, p1) 附加字符串 strncat(p, p1, n) 附加指定长度字符串 strlen(p) 取字符串长度 strcmp(p, p1) 比较字符串 strcasecm 阅读全文
posted @ 2016-04-04 18:20 龙杉老师
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2054此题卡数据,卡爆所有数据,例如下面数据包括其他的都得成立:0012. 12..25 .25000. . 12.1000001 0012.1000001000001200 0001200012. 012.0000.025 0000.02500000000000000000000000000000000.0 0..0 .000000000000000000000000000001 1.0000000000000000000000005. 05.00000000000000第一次提交居然WA,实在无 阅读全文
posted @ 2012-04-30 19:09 龙杉老师
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2093本题即为字符串处理以及sscanf函数以及排序的应用.sscanf函数的应用对此题有了很大帮助,方便快捷的得到字符串中的整形数据。要先对姓名按字典排序,以应对AC的题数和罚时都相同的情况。AC代码:#include<iostream>using namespace std;#include<string.h>char s[1000][15]={0};int A[1000]={0},B[1000]={0};int main(){ //freopen("d:\\1 阅读全文
posted @ 2012-04-30 11:23 龙杉老师
摘要:~~转载请注明出处^^Phone ListProblem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 9112. Alice 97 625 9993. Bob 91 12 54 26In this case, it’s not possible to call B 阅读全文
posted @ 2012-04-14 19:32 龙杉老师