字符串问题
稳健的不二少年
代码简洁,思维严谨,每遇不会,必求甚解。
展开
-
Codeforces Round #535 (Div. 3)C
题目来源:https://codeforces.com/problemset/problem/1108/C You have a garland consisting of原创 2019-07-25 10:48:48 · 106 阅读 · 0 评论 -
POJ3981字符串替换
字符串替换问题 传送门:http://poj.org/problem?id=3981 Description 编写一个C程序实现将字符串中的所有"you"替换成"we" Input 输入包含多行数据 每行数据是一个字符串,长度不超过1000 数据以EOF结束 Output 对于输入的每一行,输出替换后的字符串 Sample Input you are what you do Sample Outp...原创 2019-08-09 15:31:39 · 153 阅读 · 0 评论 -
字符串的一些操作
=,assign() //赋以新值 s.assign(str); s.assign(str,1,3);//如果str是”iamangel” 就是把”ama”赋给字符串 s.assign(str,2,string::npos);//把字符串str从索引值2开始到结尾赋给s s.assign(“gaint”); s.assign(“nico”,5);//把’n’ ‘I’ ‘c’ ‘o’ ‘\0...原创 2019-08-09 15:33:04 · 132 阅读 · 0 评论 -
hdu1062Text Reverse
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1062 字符串翻转问题。 Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and...原创 2019-08-09 16:12:03 · 104 阅读 · 0 评论 -
洛谷P1308统计单词数
传送门:https://www.luogu.org/problem/P1308 题意: 一般的文本编辑器都有查找单词的功能,该功能可以快速定位特定单词在文章中的位置,有的还能统计出特定单词在文章中出现的次数。 现在,请你编程实现这一功能,具体要求是:给定一个单词,请你输出它在给定的文章中出现的次数和第一次出现的位置。注意:匹配单词时,不区分大小写,但要求完全匹配,即给定单词必须与文章中的某一独立单...原创 2019-08-09 20:55:38 · 239 阅读 · 0 评论