2012年1月16日

qsort 的用法

摘要: 快速排序qsort真的很强大一、对int类型数组排序int num[100];int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100];int cmp( const void *a , const void *b ){return *(char *)a - *(int *)b;}qsort(word,100,sizeof(word[0]),cmp);三、对double类型 阅读全文

posted @ 2012-01-16 12:10 [S*I]SImMon_WCG______* 阅读(249) 评论(0) 推荐(0) 编辑

HDU 1004 Let the Balloon Rise

摘要: Let the Balloon RiseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30662Accepted Submission(s): 10048Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time 阅读全文

posted @ 2012-01-16 11:52 [S*I]SImMon_WCG______* 阅读(222) 评论(0) 推荐(0) 编辑

strstok详解

摘要: extern char *strtok(char *s, char *delim);用法:#include <string.h> 功能:分解字符串为一组标记串。s为要分解的字符串,delim为分隔符字符串。 说明:首次调用时,s必须指向要分解的字符串,随后调用要把s设成NULL。 strtok在s中查找包含在delim中的字符并用NULL('\0')来替换,直到找遍整个字符串。 返回指向下一个标记串。当没有标记串时则返回空字符NULL。 1 #include<stdio.h> 2 #include<string.h> 3 #include&l 阅读全文

posted @ 2012-01-16 11:02 [S*I]SImMon_WCG______* 阅读(580) 评论(0) 推荐(0) 编辑

HDU 2072 单词数

摘要: 单词数Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12939Accepted Submission(s): 3310Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。Outp 阅读全文

posted @ 2012-01-16 10:55 [S*I]SImMon_WCG______* 阅读(1061) 评论(0) 推荐(0) 编辑

导航