字符串
jinghaize
心所向力能及,定当竭尽全力
展开
-
算法笔记3.6问题 C: 字符串的查找删除
题目描述给定一个短字符串(不含空格),再给定若干字符串,在这些字符串中删除所含有的短字符串。输入输入只有1组数据。输入一个短字符串(不含空格),再输入若干字符串直到文件结束为止。输出删除输入的短字符串(不区分大小写)并去掉空格,输出。样例输入in#includeint main(){printf(" Hi ");}样例输出#cludetma(){prtf(“Hi”);}代码#include<cstdio>#include<cs原创 2021-05-16 20:02:07 · 109 阅读 · 0 评论 -
算法笔记3.6B: 首字母大写
题目描述对一个字符串中的所有单词,如果单词的首字母不是大写字母,则把单词的首字母变成大写字母。在字符串中,单词之间通过空白符分隔,空白符包括:空格(’ ‘)、制表符(’\t’)、回车符(’\r’)、换行符(’\n’)。输入输入一行:待处理的字符串(长度小于100)。输出可能有多组测试数据,对于每组数据,输出一行:转换后的字符串。样例输入if so, you already have a google account. you can sign in on the right.原创 2021-05-11 10:23:03 · 108 阅读 · 0 评论 -
算法笔记3.6A: 字符串连接(基本题)
题目描述不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。输入每一行包括两个字符串,长度不超过100。输出可能有多组测试数据,对于每组数据,不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。输出连接后的字符串。样例输入abc def样例输出abcdef代码#include<cstdio>#include<cstring>int main(){ char str1[100]原创 2021-03-26 20:28:06 · 117 阅读 · 0 评论 -
算法笔记3.3B:Hello World for U
题目描述Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, “helloworld” can be printed as:h de ll rlowoThat is, the characters must be printed in the original order, starting top-down原创 2021-03-02 09:50:53 · 65 阅读 · 0 评论