![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
文章平均质量分 78
MrQ_zh
这个作者很懒,什么都没留下…
展开
-
UVA-455 Periodic Strings
问题:求周期字符串最小周期分析:枚举暴力求解,本来想用数学方法的感觉有点麻烦了,思路就是将字符串用1-strlen来整除,然后从上个周期的末尾开始比较,有不同则为不对。如果一直比较完都相等则为最小周期,最后的换行是按题目要求来的。#include#includeint main(){ int q; scanf("%d",&q); while(q--)原创 2016-11-13 10:50:25 · 278 阅读 · 0 评论 -
UVA_Circular Sequence
问题:环形字符串从中间切开,找最小字典序;分析:暴力求解,把字符串不断向后移位产生新的字符串然后比较,用到strcmp比较字典序,strcpy复制字符串#include#includeint main(){ int q; scanf("%d",&q); while(q--){ char a[101],amin[101],c; scanf("%s",&a); int原创 2016-11-13 12:48:50 · 287 阅读 · 0 评论 -
C++ stringstream介绍,使用方法与例子
今天在学STL中 (集合:set)时,发现stringstream,然而并不知道什么意思。经过网上的查询,才知道是一种输入输出流,由于刚接触,感觉这博文感觉很有帮助,所以转载,供以后使用。http://blog.csdn.NET/joeblackzqq/article/details/7032703C++引入了ostringstream、istr转载 2016-12-03 14:12:13 · 6008 阅读 · 0 评论 -
UVA 10815 Andy's First Dictionary
Andy's First DictionaryAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instea原创 2016-12-03 14:55:46 · 288 阅读 · 0 评论 -
UVA 156 map容器使用
Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute,原创 2016-12-04 15:39:51 · 245 阅读 · 0 评论 -
HDU-2054 A==B?
Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Inputeach test case contains two numbers A and B. Outputfor each case, i原创 2016-12-23 18:08:50 · 308 阅读 · 0 评论 -
C语言string.h常用函数总结
void *memcpy(void *dest, const void *src, size_t n);从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中.void *memmove( void* dest, const void* src,size_t count);由src所指内存区域复制count个字节到dest所指内存区域。m转载 2016-12-30 18:15:58 · 424 阅读 · 0 评论 -
HDU-2030 汉字统计(水题)
问题:如题方法:就一点。。。汉子的ascii码小于零,一个汉子占两个ascii码#includeint main(){ char t; int n; scanf("%d",&n); getchar(); while(n--){ int sum=0; while((t=getchar())!='\n'){ if(t<0){ sum++; } }原创 2017-01-31 23:38:04 · 312 阅读 · 0 评论 -
POJ-1854 Evil Straw Warts Live
A palindrome is a string of symbols that is equal to itself when reversed. Given an input string, not necessarily a palindrome, compute the number of swaps necessary to transform the string into a pal原创 2017-04-17 22:03:26 · 382 阅读 · 0 评论