字符串
jinghaize
心所向力能及,定当竭尽全力
展开
-
算法笔记3.6问题 C: 字符串的查找删除
题目描述 给定一个短字符串(不含空格),再给定若干字符串,在这些字符串中删除所含有的短字符串。 输入 输入只有1组数据。 输入一个短字符串(不含空格),再输入若干字符串直到文件结束为止。 输出 删除输入的短字符串(不区分大小写)并去掉空格,输出。 样例输入 in #include int main() { printf(" Hi "); } 样例输出 #clude tma() { prtf(“Hi”); } 代码 #include<cstdio> #include<cs原创 2021-05-16 20:02:07 · 123 阅读 · 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 · 116 阅读 · 0 评论 -
算法笔记3.6A: 字符串连接(基本题)
题目描述 不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。 输入 每一行包括两个字符串,长度不超过100。 输出 可能有多组测试数据,对于每组数据,不借用任何字符串库函数实现无冗余地接受两个字符串,然后把它们无冗余的连接起来。 输出连接后的字符串。 样例输入 abc def 样例输出 abcdef 代码 #include<cstdio> #include<cstring> int main(){ char str1[100]原创 2021-03-26 20:28:06 · 121 阅读 · 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 d e l l r lowo That is, the characters must be printed in the original order, starting top-down原创 2021-03-02 09:50:53 · 74 阅读 · 0 评论